Maintenance mode with PHP


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function maintenance($mode = FALSE){
  2. if($mode){
  3. if(basename($_SERVER['SCRIPT_FILENAME']) != 'maintenance.php'){
  4. header("Location: http://example.com/maintenance.php");
  5. }
  6. }else{
  7. if(basename($_SERVER['SCRIPT_FILENAME']) == 'maintenance.php'){
  8. header("Location: http://example.com/");
  9. }
  10. }
  11. }

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.