I have this problem with a script for an email form that does some checking of the input to the form before it processes it. It is coming back with error:
Parse error: parse error, unexpected $end in c:\Inetpub\wwwroot\secure_mail\mail_test.php on line 76
I have gone through over and over on this and can't see what the problem is. I am somewhat of a n00b with php, so I can understand that I am probably just missing something that is small. Here is the code that I am having the problem with:
<?php
//checks to see if form data has \r or \n and does not send mail if they exist
$from=$_POST["txtemail"];
if (eregi("\r",$from) || eregi("\n",$from)) {
die("Error: Some of the content you have entered is not allowed.");
}
elseif (empty($name) || empty($email) || empty($message)) {
echo $empty_fields_message;
}
// Check the refering URL
$referer = $_SERVER['HTTP_REFERER'];
// Get the URL of this page
$this_url = "http://".$_SERVER['HTTP_HOST'].$_SERVER["REQUEST_URI"];
// If the referring URL and the URL of this page don't match then
// display a message and don't send the email.
if ($referer != $this_url) {
echo "You do not have permission to use this script from another URL.";
exit;
}
else {
// The URLs matched so send the email
mail($your_email, $subject, $message, "From: $name <$email>");
// Display the thankyou message
echo $thankyou_message;
}
?>
I am thinking that I did not close a tag or something but for the life of me I can't see where. If anyone could help me with this I would appreciate it
Thank you.