Imtehbegginer Posted February 24, 2007 Share Posted February 24, 2007 I was wondering if I could give an error, that would STOP the script, but not cut out the rest of the page? Is there anyway to do this? For example. if($pass != $pass2) { die('Passwords do not match!'); # This is where it deletes half of the page.... } Link to comment https://forums.phpfreaks.com/topic/39866-stop-the-script-without-die/ Share on other sites More sharing options...
Archadian Posted February 24, 2007 Share Posted February 24, 2007 try endif; I saw it in someone's code...worth a try if($pass != $pass2) { echo "Password does not match"; endif; } Link to comment https://forums.phpfreaks.com/topic/39866-stop-the-script-without-die/#findComment-192611 Share on other sites More sharing options...
JBS103 Posted February 24, 2007 Share Posted February 24, 2007 I guess you could potentially set a variable that you could check at specific points in the script to see whether or not that piece should be run. Currently, I am unaware of any function that will do this for you. Someone with more experience may be able to offer more advice. Link to comment https://forums.phpfreaks.com/topic/39866-stop-the-script-without-die/#findComment-192619 Share on other sites More sharing options...
chrisredding Posted February 24, 2007 Share Posted February 24, 2007 Yeah, if (!$haircolour) { $err.= "Please provide your email haircolour<br>"; } and then if you code the output to remain at the same page, it'll stop at every error. Have a look at http://www.chrisredding.com/v4/gen/form/contact.php and try some obvious errors. C Link to comment https://forums.phpfreaks.com/topic/39866-stop-the-script-without-die/#findComment-192629 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.