I am trying to use This PHP Mail form,
and I keep getting syntax errors on 2 different lines. Line 70, and 72.
This is what is on those lines.
if (isset($requiredFields['name']) && !empty($_POST['name']) !preg_match("/^[a- zA-Z-'\s]*$/", stripslashes($_POST['name'])))
$error_msg .= "The name field must not contain special characters.
";
if (isset($requiredFields['email']) && !empty($_POST['email'] && !preg_match('/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+' . '(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i', strtolower($_POST['email'])))
$error_msg .= "That is not a valid e-mail address.
";
Checking this file against a PHP syntax checker here.
http://www.meandeviation.com/tutorials/learnphp/php-syntax-check/v5-3/syntax-check.php
first it said: unexpected '!'
Then I removed the '!' and rechecked, it showed "unexpected T_BOOLEAN_AND, expecting ')'"
So I am a little lost, Not quite sure how I can configure this correctly. I dont really mind if the Name Checker doesn't work, but its the Email validator that I care about. Because you could write: "Email: Gorilla" or something and it would send to my email. So to prevent random spam and useless contact information, I would prefer the email to pass validation.
I am a bit new to PHP, so I am not quite sure where I should go from here, Any thoughts anyone? Id appreciate the help.
Take care folks!