I've been pondering an idea - if I am updating a MySQL db, I'd like to temporarily switch off the site. I was thinking of placing a command in a common include file - the first file that is included in all pages. If I have set the db so that the site is unavailable, I'd like to redirect to a generic 'site being updated' page. This is what I tried:

if ($row_rsSiteAvailability['site_availability']==0)
header("Location: /site-unavailable/");

But in Firefox it's moaning about the redirect.

"Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked."

Can someone suggest what I'm doing wrong? Or a better way of doing this?

On a similar topic, rather than doing a redirect, is there a PHP command that basically means "stop processing enything else on this page". If that's possible, I could write out the 'site being updated' message and then do that stop command.

Any tips appreciated!