Parse error in mail()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
elinews
Forum Commoner
Posts: 38
Joined: Tue Aug 14, 2007 7:18 pm

Parse error in mail()

Post by elinews »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


why am I getting unexpected T_string in this?

Code: Select all

<?
@extract($_POST);
$name = stripslashes($name);
$title = stripslashes($title);
$email = stripslashes($email);
$text = stripslashes($text);
mail('example@hotmail.com',Calendar Request - $title,$title has been requested to be added to the 
Calendar page. Click on the link below to either approve or decline this request: <br> 

<a 

href='http://www.sample.org/sample.php?=$id'>http://www.sample.org/sample.php?=$id

</a> <br> To view all requested events, visit this page: <br> <a 

href='http://www.sample.org/sample.php'>http://www.sample.org/sample.php</a>,"From: 

$name <example@msn.com>");
header("location:form.php");
?>
Thanks in advance


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: Parse error in mail()

Post by volka »

elinews wrote:mail('example@hotmail.com',Calendar Request - $title
The green part is a single-quoted string. But what is the red part?
elinews
Forum Commoner
Posts: 38
Joined: Tue Aug 14, 2007 7:18 pm

Post by elinews »

That's the subject line
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Why did you put the first string in single-quotes but the following strings in no quotes at all?
Strings have to be marked for php. See http://de2.php.net/language.types.string
Post Reply