I receive this error message when I click submit on my contact page (www.cateredvibes.com/contactus.html)
Parse error: syntax error, unexpected '[' in /home2/zomjwzgn/public_html/process123.php on line 70
How do I correct this? Please help!
Here is my full script:
<?php
$advertisement = $HTTP_POST_VARS['advertisement'];
$name = $HTTP_POST_VARS['name'];
$phone = $HTTP_POST_VARS['phone'];
$city = $HTTP_POST_VARS['city'];
$email = $HTTP_POST_VARS['email'];
$event = $HTTP_POST_VARS['event'];
$date = $HTTP_POST_VARS['date'];
$guests = $HTTP_POST_VARS['guests'];
$start = $HTTP_POST-VARS['start'];
$end = $HTTP_POST_VARS['end'];
$details = $HTTP_POST_VARS['details'];
if (strlen($advertisement) == 0)
{
echo "It appears that you have forgot to fill in the How did you hear about us? field. Please use the Back Button to return to the form and fill in How you
heard about us. Thank you!";
exit;
}
if (strlen($advertisement) >=30)
{
echo "The length limit for the How did you hear about us? field cannot exceed 30 characters / spaces. Please use the Back Button to return to the form and
shorten this entry. Thank you!";
exit;
}
if (strlen($name) == 0)
{
echo "It appears that you have forgot to fill in your name in the Name field. Please use the Back Button to return to the form and enter your name. Thank
you!";
exit;
}
if (strlen($name) >=30)
{
echo "The length limit for the Name field cannot exceed 30 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($phone) == 0)
{
echo "It appears that you have forgot to fill in your phone number. Please use the Back Button to return to the form and enter your number. Thank you!";
exit;
}
if (strlen($phone) >=14)
{
echo "Your phone number cannot exceed 14 characters / spaces. Please use the Back Button to return to the form and shorten this entry. Thank you!";
exit;
}
if (strlen($city) == 0)
{
echo "It appears that you have forgot to fill in your City, STate, and Zip. Please use the Back Button to return to the form and enter that information.
Thank you!";
exit;
}
if (strlen($city) >=30)
{
echo "The length limit for the City, St Zip field cannot exceed 30 characters / spaces. Please use the Back Button to return to the form and shorten this
entry. Thank you!";
exit;
}
if (strlen($email) == 0)
{
echo "The E-mail field is a required entry. Please use the Back Button to return to the form and enter a contact E-mail address. Thank you!";
exit;
}
if (strlen($email) >= 45)
{
echo "The length limit for the E-Mail field cannot exceed 45 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
{
echo "I believe that there is an error in the way you entered your E-mail address. Please check your entry and re-submit. Thank you!";
exit;
}
if (strlen($event) == 0)
{
echo "It appears that you have forgot to fill in your type of event. Please use the Back Button to return to the form and enter your event type. Thank
you!";
exit;
}
if (strlen($event) >=30)
{
echo "The length limit for the Name field cannot exceed 30 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($date) == 0)
{
echo "It appears that you have forgot to fill in your the date of your event. Please use the Back Button to return to the form and enter the event date.
Thank you!";
exit;
}
if (strlen($date) >=1
{
echo "The length limit for the Name field cannot exceed 18 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($guests) == 0)
{
echo "It appears that you have forgot to fill in the number of guests you expect to attend. Please use the Back Button to return to the form and enter the
estimated number of guest that you expect to attend. Thank you!";
exit;
}
if (strlen($guests) >=6)
{
echo "The length limit for the Name field cannot exceed 6 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($start) == 0)
{
echo "It appears that you have forgot to fill in your start time. Please use the Back Button to return to the form and enter what time your event starts.
Thank you!";
exit;
}
if (strlen($start) >=
{
echo "The length limit for the Name field cannot exceed 8 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($end) == 0)
{
echo "It appears that you have forgot to fill in your end time. Please use the Back Button to return to the form and enter what time your event ends. Thank
you!";
exit;
}
if (strlen($end) >=
{
echo "The length limit for the Name field cannot exceed 8 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($details) >= 300)
{
echo "The details of your setup and meal area is limited to 300 characters / spaces. It appears that you have exceeded that limit. Please use the back
button to return to the form and shorten this entry.Thank you!";
exit;
}
if (substr_count($comments , '@') > "2")
{
echo "For security reasons this text (comments) area limits the number of @ symbols that can appear within it. It would appear that you have exceeded that
number. Please use the Back Button to return to the form and correct this. Thank you for your patience!";
exit;
}
//SEND MAIL
$mailto = "bob@cateredvibes.com";
$mailsubj = "Catering Inquiry Form";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Website Submission form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto,$mailsubj,$mailbody,$mailhead);
echo "Thank you for visiting our site and filling out our form. We will get back to you within 48 hours!";
?>
Parse error: syntax error, unexpected '[' in /home2/zomjwzgn/public_html/process123.php on line 70
How do I correct this? Please help!
Here is my full script:
<?php
$advertisement = $HTTP_POST_VARS['advertisement'];
$name = $HTTP_POST_VARS['name'];
$phone = $HTTP_POST_VARS['phone'];
$city = $HTTP_POST_VARS['city'];
$email = $HTTP_POST_VARS['email'];
$event = $HTTP_POST_VARS['event'];
$date = $HTTP_POST_VARS['date'];
$guests = $HTTP_POST_VARS['guests'];
$start = $HTTP_POST-VARS['start'];
$end = $HTTP_POST_VARS['end'];
$details = $HTTP_POST_VARS['details'];
if (strlen($advertisement) == 0)
{
echo "It appears that you have forgot to fill in the How did you hear about us? field. Please use the Back Button to return to the form and fill in How you
heard about us. Thank you!";
exit;
}
if (strlen($advertisement) >=30)
{
echo "The length limit for the How did you hear about us? field cannot exceed 30 characters / spaces. Please use the Back Button to return to the form and
shorten this entry. Thank you!";
exit;
}
if (strlen($name) == 0)
{
echo "It appears that you have forgot to fill in your name in the Name field. Please use the Back Button to return to the form and enter your name. Thank
you!";
exit;
}
if (strlen($name) >=30)
{
echo "The length limit for the Name field cannot exceed 30 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($phone) == 0)
{
echo "It appears that you have forgot to fill in your phone number. Please use the Back Button to return to the form and enter your number. Thank you!";
exit;
}
if (strlen($phone) >=14)
{
echo "Your phone number cannot exceed 14 characters / spaces. Please use the Back Button to return to the form and shorten this entry. Thank you!";
exit;
}
if (strlen($city) == 0)
{
echo "It appears that you have forgot to fill in your City, STate, and Zip. Please use the Back Button to return to the form and enter that information.
Thank you!";
exit;
}
if (strlen($city) >=30)
{
echo "The length limit for the City, St Zip field cannot exceed 30 characters / spaces. Please use the Back Button to return to the form and shorten this
entry. Thank you!";
exit;
}
if (strlen($email) == 0)
{
echo "The E-mail field is a required entry. Please use the Back Button to return to the form and enter a contact E-mail address. Thank you!";
exit;
}
if (strlen($email) >= 45)
{
echo "The length limit for the E-Mail field cannot exceed 45 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
{
echo "I believe that there is an error in the way you entered your E-mail address. Please check your entry and re-submit. Thank you!";
exit;
}
if (strlen($event) == 0)
{
echo "It appears that you have forgot to fill in your type of event. Please use the Back Button to return to the form and enter your event type. Thank
you!";
exit;
}
if (strlen($event) >=30)
{
echo "The length limit for the Name field cannot exceed 30 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($date) == 0)
{
echo "It appears that you have forgot to fill in your the date of your event. Please use the Back Button to return to the form and enter the event date.
Thank you!";
exit;
}
if (strlen($date) >=1
{
echo "The length limit for the Name field cannot exceed 18 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($guests) == 0)
{
echo "It appears that you have forgot to fill in the number of guests you expect to attend. Please use the Back Button to return to the form and enter the
estimated number of guest that you expect to attend. Thank you!";
exit;
}
if (strlen($guests) >=6)
{
echo "The length limit for the Name field cannot exceed 6 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($start) == 0)
{
echo "It appears that you have forgot to fill in your start time. Please use the Back Button to return to the form and enter what time your event starts.
Thank you!";
exit;
}
if (strlen($start) >=
{
echo "The length limit for the Name field cannot exceed 8 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($end) == 0)
{
echo "It appears that you have forgot to fill in your end time. Please use the Back Button to return to the form and enter what time your event ends. Thank
you!";
exit;
}
if (strlen($end) >=
{
echo "The length limit for the Name field cannot exceed 8 characters / spaces. Please use the Back Button to return to the form and shorten this entry.
Thank you!";
exit;
}
if (strlen($details) >= 300)
{
echo "The details of your setup and meal area is limited to 300 characters / spaces. It appears that you have exceeded that limit. Please use the back
button to return to the form and shorten this entry.Thank you!";
exit;
}
if (substr_count($comments , '@') > "2")
{
echo "For security reasons this text (comments) area limits the number of @ symbols that can appear within it. It would appear that you have exceeded that
number. Please use the Back Button to return to the form and correct this. Thank you for your patience!";
exit;
}
//SEND MAIL
$mailto = "bob@cateredvibes.com";
$mailsubj = "Catering Inquiry Form";
$mailhead = "From: $email\n";
reset ($HTTP_POST_VARS);
$mailbody = "Website Submission form:\n";
while (list ($key, $val) = each ($HTTP_POST_VARS))
{
$mailbody .= "$key : $val\n";
}
mail($mailto,$mailsubj,$mailbody,$mailhead);
echo "Thank you for visiting our site and filling out our form. We will get back to you within 48 hours!";
?>
Comment