Jump to content

I'm New With Php


richscom
 Share

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. :)

Edited by richscom
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. Edited by TKW22
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.

Edited by Reiyan
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...