patgod Posted May 1, 2008 Share Posted May 1, 2008 Hi everyone, I am look for over an hour for a simple script to "take down" my website whenever i trigger it to (though a simple backend?) I have a website baker based website and i need to take down the site in specific times - in which the people trying to view the website will only be able to get the html page i designed for these cases. Is there such a thing? Thanks Link to comment https://forums.phpfreaks.com/topic/103706-simple-php-website-shutdown-script/ Share on other sites More sharing options...
ionik Posted May 1, 2008 Share Posted May 1, 2008 create a database table and have something like this |-shutdown |- shutdown 1 or 0 |- USERIP User ip that is allowed to view and just run that query a query that says if shutdown = 1 and USERIP <> userip show a website is shutdown page. This is quite a simple solution and allmost all websites have this kind of feature expect it is done in a more complex solution Link to comment https://forums.phpfreaks.com/topic/103706-simple-php-website-shutdown-script/#findComment-530969 Share on other sites More sharing options...
discomatt Posted May 1, 2008 Share Posted May 1, 2008 Upload a file called 'settings.php' with the following code <?php define( 'SITE_DISABLED', 1 ); ?> Then on the top of your pages <?php include ( 'settings.php' ); if ( defined( 'SITE_DISABLED' ) && SITE_DISABLED == 1 ) { header('Location: site_down.php'); exit(); } # continue with script ?> Link to comment https://forums.phpfreaks.com/topic/103706-simple-php-website-shutdown-script/#findComment-530974 Share on other sites More sharing options...
patgod Posted May 1, 2008 Author Share Posted May 1, 2008 thanks! Link to comment https://forums.phpfreaks.com/topic/103706-simple-php-website-shutdown-script/#findComment-531003 Share on other sites More sharing options...
947740 Posted May 1, 2008 Share Posted May 1, 2008 Is this kind of technique often used for companies that want to rehaul their website? It would make sense, but I do not know that much about big companies and their websites. Link to comment https://forums.phpfreaks.com/topic/103706-simple-php-website-shutdown-script/#findComment-531006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.