I cannot get this to work for the life of me, it is PHP.
<?php
if (!isset($_POST['ign']) || ($_POST['email'])) {
echo "Please enter all of the values!";
}
else {
echo "Thanks, " . $_POST['ign'] . ", you will recieve an email when the site is complete!";
}
?>
I've also tried using !isset twice.
The isset() function checks whether a variable is set, which means that it has to be declared and is not NULL. This function returns true if the variable exists and is not NULL, otherwise it returns false.
isset( $_POST['submit'] ) : This line checks if the form is submitted using the isset() function, but works only if the form input type submit has a name attribute (name=”submit”).
The isset function in PHP is used to determine whether a variable is set or not. A variable is considered as a set variable if it has a value other than NULL. In other words, you can also say that the isset function is used to determine whether you have used a variable in your code or not before.
The isset() function is an inbuilt function in PHP that is used to determine if the variable is declared and its value is not equal to NULL. The empty() function is an inbuilt function in PHP that is used to check whether a variable is empty or not.
This is how I solved this issue:
$expression = $_POST['ign'] || $_POST['email'] ;
if (!isset($expression) {
echo "Please enter all of the values!";
}
else {
echo "Thanks, " . $_POST['ign'] . ", you will recieve an email when the site is
complete!";
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With