Page 1 of 1

stop a page from loading

Posted: Sun Apr 20, 2008 9:19 pm
by marshall_now
Hello,
basically I want to know if there is any type of script that can be used to block a page from loading.
The reason is that i want to be able to change a mysql database entry from "open" to "block", and have a php function that will check that row and, if it says block then stop the script from reading on, and simply stop anything from loading. If it says open, then i want it to simply read on and execute the script.

This may not make a lot of sense as far as the reasoning, but any ideas help.
Thanks

Re: stop a page from loading

Posted: Sun Apr 20, 2008 10:04 pm
by John Cartwright
you can use exit() to terminate the script execution. I.e.,

Code: Select all

if ($row['status'] == 'block') {
   exit();
}
 
//rest of code here