Link to home
Start Free TrialLog in
Avatar of ststesting
ststesting

asked on

php mailer (missing brackets?)

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
Avatar of AielloJ
AielloJ
Flag of United States of America image

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
Avatar of ststesting
ststesting

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of ststesting
ststesting

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
In your code the EOD; on lines 95, 102, etc. must be in the first column.  It cannot be indented.
Avatar of Dave Baldwin
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

figured out what I was missing