Stopping an if clause along with the whole PHP script, but not HTML
- by user626816
Hello there,
I've been having this problem for around an hour, and have searched the internet for answers. I've checked the PHP documentation, looked around, Googled, nothing.
Anyways, my problem is that after I try to validate something (and it's wrong), if I use exit; it will also stop the HTML after. Here's what I'm talking about:
if ($_POST['exampleEmail'] == "")
{
echo "Please enter an e-mail."; //Now I want only the PHP script to stop, however...
exit; //If I use exit, then the HTML after this script (footer) doesn't show.
}
If anyone can help, please do. I've tried using break, but to no avail, since it's only for loops and switches.
If there is a better/more correct (or simply correct if this is the wrong way), please share. I've had this problem in the past, and I just used exit then.
Thanks.