diff --git a/mail/contact_me.php b/mail/contact_me.php index 85e3402..3a94356 100755 --- a/mail/contact_me.php +++ b/mail/contact_me.php @@ -11,10 +11,15 @@ if(empty($_POST['name']) || } $name = $_POST['name']; -$email_address = $_POST['email']; +$email_address = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL); +if ($email === FALSE) { + echo 'Invalid email'; + exit(1); +} $phone = $_POST['phone']; $message = $_POST['message']; + // Create the email and send the message $to = 'yourname@yourdomain.com'; // Add your email address inbetween the '' replacing yourname@yourdomain.com - This is where the form will send a message to. $email_subject = "Website Contact Form: $name";