need help with php comment sender
i am having problems with my php sender,
the code that i put in my webpage is
<form action="http://comments.krakingswood.co.uk/sent.php" method="post">
Your Name: <input type="text" name="name"><br>
Your E-mail (optional): <input type="text" name = "email"><br><br>
Comments<br>
<textarea name="comments"></textarea><br><br>
<input type="submit" value="Submit">
</form>
the coding in the php file is
<?php
function checkOK($field)
{
if (eregi("\r",$field) || eregi("\n",$field)){
die("Invalid Input!");
}
}
$name=$_POST['name'];
checkOK($name);
$email=$_POST['email'];
checkOK($email);
$comments=$_POST['comments'];
checkOK($comments);
$to="abuse@krakingswood.co.uk";
$message="This is a new comment posted by $name. They posted it from the email address of: $email"\n $comments"\n;
if(mail($to,"Website Abuse",$message,"From: $email\n")) {
echo "Thank you for your help. We will try to sort out the problems as soon as possible.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>
and i get the following error message up when i am testing it
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/david/public_html/comments/sent.php on line 16
Parse error: parse error, unexpected T_STRING in /home/david/public_html/comments/sent.php on line 16
can you please help me on this??
thanks
dave

