Page 1 of 1

Parse error in mail()

Posted: Thu Sep 20, 2007 7:35 pm
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]

Re: Parse error in mail()

Posted: Thu Sep 20, 2007 7:43 pm
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?

Posted: Thu Sep 20, 2007 8:00 pm
by elinews
That's the subject line

Posted: Thu Sep 20, 2007 8:29 pm
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