| <?php
// The empty
function checks to see if the variable is empty and the trim function
trims any white space.
if (empty(trim($name))
|| empty(trim($email)))
{
// if empty field
then show error message and exit script.
echo 'Error! You have not entered all required information.';
}
// if not empty
then process form
else
{
// process form
}
?>
|