Posted By

math89 on 07/20/10


Tagged

maintenance


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

NyX
convergine


Maintenance mode with PHP


 / Published in: PHP
 

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

  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. }

Report this snippet  

You need to login to post a comment.