richscom Posted April 22, 2009 Share Posted April 22, 2009 Hi, i'm fairly new with PHP, and i tried to make a contact form, and when i run it on a server i get this: "Parse error: syntax error, unexpected T_VARIABLE in /home/richscom/public_html/contact.php on line 87"This is the PHP script:<?php$to = "Blah@blah.com";$subject = $_POST["title"];$name = $_POST["name"]$message = $_POST["message"]; This is line 87$messagesent = "From: $name Message: $message";$from = $_POST["email"];$headers = "From: $from";mail($to,$subject,$messagesent,$headers);echo "Your message has been sent, thank you.";?>Any help on how to fix this would be greatly appreciated. Link to comment Share on other sites More sharing options...
TKW22 Posted April 22, 2009 Share Posted April 22, 2009 Hi, i'm fairly new with PHP, and i tried to make a contact form, and when i run it on a server i get this: "Parse error: syntax error, unexpected T_VARIABLE in /home/richscom/public_html/contact.php on line 87"This is the PHP script:<?phplook here { $name = $_POST["name"] }you forgot ; at the end$message = $_POST["message"]; This is line 87?>Any help on how to fix this would be greatly appreciated. look in the quoteyou may want to make a code before the sending of the e-mail to insure that there using a real e-mail. Link to comment Share on other sites More sharing options...
richscom Posted April 22, 2009 Author Share Posted April 22, 2009 look in the quoteyou may want to make a code before the sending of the e-mail to insure that there using a real e-mail.Thanks, i just realized that now and i feel fairly retarded. Link to comment Share on other sites More sharing options...
johnjl Posted April 25, 2009 Share Posted April 25, 2009 that's OK for a newbie like as in PHP Programming.**always terminate PHP-Statements with ( Link to comment Share on other sites More sharing options...
johnjl Posted April 25, 2009 Share Posted April 25, 2009 that's OK for a newbie like as in PHP Programming.**always terminate PHP-Statements with ";" Link to comment Share on other sites More sharing options...
danm68 Posted April 28, 2009 Share Posted April 28, 2009 If you haven't got it I'll make it clear, you need to add a semi-colon ";" at the end of line 86 ($name = $_POST["name']). What I've found is that sometimes the error might be on a line before the line that is given in the error message. I don't know how the error parsing etc works, but in general when you get an error, try looking at the line above as well. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.