I cannot get this to work for the life of me, it is PHP.
When you work with POST, use empty()
. because when your form send data. It async null for empty input!
best way is that:
if ((!isset($_POST['ign']) || empty($_POST['ign'])) &&
(!isset($_POST['email']) || empty($_POST['email'])) {
YES! It's Ugly...
So you can use:
<?php
if ( checkInput($_POST['ign']) || checkInput($_POST['email']) ) {
echo "Please enter all of the values!";
}
else {
echo "Thanks, " . $_POST['ign'] . ", you will recieve an email when the site is complete!";
}
function checkInput($input){
return ( !isset($input) || empty($input) );
}
?>
You can try this code:
<?php
if(!isset($_POST['ign'], $_POST['email'])) {
echo "Please enter all of the values!";
} else {
echo "Thanks, " . $_POST['ign'] . ", you will receive an email when the site is complete!";
}
?>