Jump to content

I'm New With Php


richscom

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...