Getting a Parse Error when attempting to submit my form to my php form processing script.
Parse error: syntax error, unexpected T_VARIABLE in /home/amoodf5/public_html/greatmoods/site/cgi-bin/dealerentryform.php on line 43
Line 43 is the $message, but I don't know what is wrong with it. Any insight on the problem would be greatly appreciated.
Thanks in advance,
Mark
<?php
$myemail = "example@example.com";
$repname = check_input($_POST['repname'],"Sales Rep Name Required");
$dealername = check_input($_POST['dealername'],"Sales Rep Name Required");
$address1 = check_input($_POST['address1']);
$address2 = check_input($_POST['address2']);
$city = check_input($_POST['city']);
$state = check_input($_POST['state']);
$zip = check_input($_POST['zip']);
$weekdayhours = check_input($_POST['weekdayhours']);
$weekendhours = check_input($_POST['weekendhours']);
$otherproducts = check_input($_POST['otherproducts']);
$about = check_input($_POST['about']);
$email = htmlspecialchars($_POST['email']);
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$email))
{
$email = '';
}
$url = htmlspecialchars($_POST['website']);
if (!preg_match("/^(https?:\/\/+[\w\-]+\.[\w\-]+)/i",$url))
{
$url = '';
}
$phone = htmlspecialchars($_POST['website']);
if (preg_match("/\D/",$phone))
{
die("Please enter numbers only for the Phone Number");
}
$fax = htmlspecialchars($_POST['website']);
if (preg_match("/\D/",$fax))
{
die("Please enter numbers only for the Fax Number");
}
$subject = "Dealer Website Request ($repname)"
$message = "Hello! This is a Dealer Request for $dealername from $repname.
Dealer: $dealername
E-mail: $email
Address: $dealername, $address1, $address2, $city, $state $zip
Phone Number: $phone
Fax Number: $fax
About the Company: $about
Other Products: $otherproducts
Weekday Hours: $weekdayhours
Weekend Hours: $weekendhours
";
mail($myemail, $subject, $message);
header('Location: /site/thankyou.php');
exit();
function check_input($data)
{
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
if ($problem && strlen($data) == 0)
{
show_error($problem);
}
return $data;
}
function show_error($myError)
{
?>
<html>
<body>
<b>Please correct the following error:</b><br />
<?php echo $myError; ?>
</body>
</html>
<?php
exit();
}
?>