I have written out some code for a PHP contact form. On my 'contact us' page, I have given the form the action: sendmail.php (yes, the file is called sendmail.php
). Here is the code I used:
Then, when I use localhost (which has PHP enabled) and try to send an email using the form, I get this error:
Parse error: parse error, unexpected T_STRING in C:\Abyss Web Server\htdocs\lavastream\sendmail.php on line 9
Why? I need help!! I can't see any problems on line 9 or anywhere else. Can any of you?
PHP:
<?php
$to="[email protected]";
$subj="Lavastream General Enquiry";
$msg="Name: ".$_POST['name']." \r \n E-Mail: ".$_POST['email']." \r \n Message: ".$_POST['msg']." \r \n";
$header="From: ".$_POST['email'].";
if(mail($to, $subj, $msg, $header))
{
header("Location: thanks.htm");
}
else
{
header("Location: notsent.htm");
}
?>
Then, when I use localhost (which has PHP enabled) and try to send an email using the form, I get this error:
Parse error: parse error, unexpected T_STRING in C:\Abyss Web Server\htdocs\lavastream\sendmail.php on line 9
Why? I need help!! I can't see any problems on line 9 or anywhere else. Can any of you?












