Maintenance mode with PHP
Copy this code and paste it in your HTML
function maintenance($mode = FALSE){
if($mode){
if(basename($_SERVER['SCRIPT_FILENAME']) != 'maintenance.php'){ header("Location: http://example.com/maintenance.php"); }
}else{
if(basename($_SERVER['SCRIPT_FILENAME']) == 'maintenance.php'){ header("Location: http://example.com/"); }
}
}
URL: http://www.catswhocode.com/blog/10-life-saving-php-snippets
Report this snippet
Comments
Subscribe to comments