Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 312
  • Last Modified:

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.

1 Solution

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,

ststestingAuthor Commented:
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.
ststestingAuthor Commented:
Looks like there were two things, I missed a ; on line 121 $to =

And the EOD; cannot be indented.
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Scott MadeiraCommented:
In your code the EOD; on lines 95, 102, etc. must be in the first column.  It cannot be indented.
Dave BaldwinFixer of ProblemsCommented:
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

ststestingAuthor Commented:
figured out what I was missing

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now