Return to Snippet

Revision: 29046
at July 20, 2010 06:33 by math89


Initial Code
function maintenance($mode = FALSE){
    if($mode){
        if(basename($_SERVER['SCRIPT_FILENAME']) != 'maintenance.php'){
            header("Location: http://example.com/maintenance.php");
            exit;
        }
    }else{
        if(basename($_SERVER['SCRIPT_FILENAME']) == 'maintenance.php'){
            header("Location: http://example.com/");
            exit;
        }
    }
}

Initial URL
http://www.catswhocode.com/blog/10-life-saving-php-snippets

Initial Description

                                

Initial Title
Maintenance mode with PHP

Initial Tags

                                

Initial Language
PHP