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
johnnybt
Forum Newbie
Posts: 7 Joined: Sun Mar 27, 2005 9:42 pm
Post
by johnnybt » Sun Mar 27, 2005 9:50 pm
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!
evilmonkey
Forum Regular
Posts: 823 Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada
Post
by evilmonkey » Sun Mar 27, 2005 9:54 pm
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 » Sun Mar 27, 2005 9:59 pm
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
SystemWisdom
Forum Commoner
Posts: 69 Joined: Sat Mar 26, 2005 5:54 pm
Location: A Canadian South of the 49th Parallel
Post
by SystemWisdom » Sun Mar 27, 2005 10:30 pm
Code: Select all
$headers = "e;Cc: $emailrn;"e;
Should be:
Code: Select all
$headers = "e;Cc: $emailrn"e;;
Semi-colon is inside string..
johnnybt
Forum Newbie
Posts: 7 Joined: Sun Mar 27, 2005 9:42 pm
Post
by johnnybt » Sun Mar 27, 2005 10:37 pm
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!