Fix email variable issue.

This commit is contained in:
Jourdan Rodrigues 2017-06-12 21:13:02 -03:00 committed by GitHub
parent 4316c7a8ba
commit 771842ec5a
1 changed files with 4 additions and 3 deletions

View File

@ -1,18 +1,19 @@
<?php
$email_address = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
// Check for empty fields
if(empty($_POST['name']) ||
empty($_POST['email']) ||
empty($_POST['phone']) ||
empty($_POST['message']) ||
!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL))
!$email_address)
{
echo "No arguments Provided!";
return false;
}
$name = $_POST['name'];
$email_address = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
if ($email === FALSE) {
if ($email_address === FALSE) {
echo 'Invalid email';
exit(1);
}