Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

php mailer (missing brackets?)

Posted on 2012-12-27
6
Medium Priority
?
305 Views
Last Modified: 2013-01-01
This is setting up a swift mail script, I'm getting this error.
Parse error: syntax error, unexpected $end in mailer.php on line 176 (last line).

Looks like I'm supposed to be missing a bracket, but I can't find it...I need some different eyes on this.

mailer.php
0
Comment
Question by:ststesting
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 13

Expert Comment

by:AielloJ
ID: 38724593
ststesting:

The Header directive is an HTML directive not PHP.  It belongs outside the closing PHP tag.  Try the code below.

$result = $mailer->send($message);
?>

header("Location: HTTP://domain/thank-you.html")

Best regards,

AielloJ
0
 
LVL 2

Author Comment

by:ststesting
ID: 38724652
Thanks for the help, I moved that below, or just deleted it for now. My last line of code ($result...) is still highlighted like it didn't fix the problem.
0
 
LVL 2

Accepted Solution

by:
ststesting earned 0 total points
ID: 38724695
Looks like there were two things, I missed a ; on line 121 $to =

And the EOD; cannot be indented.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 14

Expert Comment

by:Scott Madeira
ID: 38724700
In your code the EOD; on lines 95, 102, etc. must be in the first column.  It cannot be indented.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 38724751
Not true, that header is a PHP function.  It is correct in your posted code. http://us1.php.net/manual/en/function.header.php

I'm not sure what is causing the error you're getting but all of your 'if' and 'elseif' statements are wrong because a single '=' is an assignment, not a comparison.  Should be:

if ($hiddest == 'contact')

Open in new window

0
 
LVL 2

Author Closing Comment

by:ststesting
ID: 38734235
figured out what I was missing
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

670 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question