Page 1 of 1

Parse errors - probably something simple but driving me mad

Posted: Sun Mar 27, 2005 9:50 pm
by johnnybt
Trying to get form data emailed to me.

Code: Select all

<?

//Declare the variables
$recipient = "entries@mysite.com";
$subject = "Team Submission";
$message =
"$name
$teamname
$email
$tiebreaker
$team\";

//contents of form

$name = $_POST['name'];
$teamname= $_POST['teamname'];
$email = $_POST['email'];
$email = $_POST['tiebreaker'];
$team = $_POST['team'];
$headers = "Cc: $email\r\n;"



//mail() function sends the mail
mail($recipient,$subject,$message,$headers);



?>
result:

Code: Select all

Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/virtual/site30/fst/var/www/html/submitted.php on line 15
Please help, really upsetting me!

Posted: Sun Mar 27, 2005 9:54 pm
by evilmonkey

Code: Select all

<?
 
//Declare the variables
$recipient = "entries@mysite.com";
$subject = "Team Submission";
$message =
"$name
$teamname
$email
$tiebreaker
$team";
 
//contents of form
 
$name = $_POST['name'];
$teamname= $_POST['teamname'];
$email = $_POST['email'];
$email = $_POST['tiebreaker'];
$team = $_POST['team'];
$headers = "Cc: $emailrn;"
 
 
 
//mail() function sends the mail
mail($recipient,$subject,$message,$headers);
 
 
 
?>

Posted: Sun Mar 27, 2005 9:59 pm
by johnnybt
I KNEW I wasn't seeing something, thank you. Sometimes it takes another set of eyes. But now I'm getting THIS error:

Parse error: parse error, unexpected T_STRING in /home/virtual/site30/fst/var/www/html/submitted.php on line 31

line 31 being my mail line

Posted: Sun Mar 27, 2005 10:30 pm
by SystemWisdom

Code: Select all

$headers = &quote;Cc: $emailrn;&quote;
Should be:

Code: Select all

$headers = &quote;Cc: $emailrn&quote;;
Semi-colon is inside string..

Posted: Sun Mar 27, 2005 10:37 pm
by johnnybt
obviously i've been looking at it too long to have missed those two things.

working now...well, the page isn't returning any errors but i'm not getting the emails! :evil: