Parse errors - probably something simple but driving me mad

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
johnnybt
Forum Newbie
Posts: 7
Joined: Sun Mar 27, 2005 9:42 pm

Parse errors - probably something simple but driving me mad

Post 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!
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post 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);
 
 
 
?>
johnnybt
Forum Newbie
Posts: 7
Joined: Sun Mar 27, 2005 9:42 pm

Post 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
User avatar
SystemWisdom
Forum Commoner
Posts: 69
Joined: Sat Mar 26, 2005 5:54 pm
Location: A Canadian South of the 49th Parallel

Post 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..
johnnybt
Forum Newbie
Posts: 7
Joined: Sun Mar 27, 2005 9:42 pm

Post 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:
Post Reply