stop a page from loading

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
marshall_now
Forum Newbie
Posts: 1
Joined: Sun Apr 20, 2008 9:14 pm

stop a page from loading

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: stop a page from loading

Post 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
Post Reply