I have contact forms on my site and they are in PHP. Almost every day I receive blank email from the forms. I do not understand why this happens because each form has a filter that requires each field to be filled before the user can click “submit”.
Below is a copy of the code of one of the PHP fields and the link to my site. Can any one point me in the right direction?
Thank you,
Lee
http://www.masterfranchises.org/chock-full-o-nuts-franchise.htm
<?PHP
// grab the information from the form
$check = false;
$site = “Chockfull o’ Nuts Coffee”;
$fname = $_POST[‘FirstName’];
$lname = $_POST[‘LastName’];
$email = $_POST[‘Email’];
$wphone = $_POST[‘WorkPhoneExt’];
$hphone = $_POST[‘HomePhone’];
$mphone = $_POST[‘MobilePhone’];
$address =($_POST[‘StreetAddress’]);
$city =($_POST[‘City’]);
$country =($_POST[‘country’]);
$state =($_POST[‘State’]);
$zipcode =($_POST[‘PostalCode’]);
$time = $_POST[‘time’];
$liquid = $_POST[‘liquid’];
$net = ($_POST[‘net’]);
$contact_time = ($_POST[‘BestTimeToContact’]);
$brokersname = ($_POST[‘BrokersName’]);
$invalid = false;
//Validate information
if( (empty($fname)) || (empty($lname)) || (empty($email)) || (empty($hphone)) ){
echo "<font color=red face=Arial size=4>You have not entered the required fields, please complete the form to recieve more information about $site Franchises.<p><i><font color=navy>This page will automatically refresh. ";
echo “<META HTTP-EQUIV=‘Refresh’
CONTENT=‘3; URL=\’>”;
$invalid = true;
}
// mail user their information
$subject = “Lead Information from $site”;
$message = "
Lead Information Generated By Master Franchise Specialists:
Name: $lname, $fname
Franchise: $site
E-mail: $email
Home Phone: $hphone
Work Phone: $wphone
Mobile Phone: $mphone
Address: $address
City: $city
Country: $country
State: $state
ZipCode: $zipcode
Liquid Capital: $liquid
Net Worth: $net
Timeframe: $time
Best Contact Time: $contact_time
Broker's Name: $brokersname
Your Lead for: $lname, $fname has been recorded.
Management Solutions Provided By: Master Franchise Specialists
";
mail($admin, $subject, $message);
if ( $check = true )
{
//mail(“customerservice@masterfranchises.org”, $subject, $message);
mail(“franmaster@sbcglobal.net”, $subject, $message);
mail(“elisandro@hotmail.com”, $subject, $message);
}
if(!$invalid){
echo “<META HTTP-EQUIV=‘Refresh’
CONTENT=‘2; URL=index.htm’>”;
echo"<font face=Arial size=3 color=navy>Thank you for your submission, your information will be processed as soon as possible. You will be redirected in 5 seconds.";
}
?>