Solved

php mailer (missing brackets?)

Posted on 2012-12-27
6
281 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
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
Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
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 83

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

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
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 …

803 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