Current location: Hot Scripts Forums » Programming Languages » PHP » How to "turn your site off" for maintenance?


How to "turn your site off" for maintenance?

Reply
  #1 (permalink)  
Old 03-23-04, 03:49 AM
Myke311 Myke311 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
How to "turn your site off" for maintenance?

I need to turn my site "off" for maintenance. Where if someone trys to load any page, they are redirected to a page that says the site is down for maintenance, will be back up shorty. A lot of message boards have this feature, a few websites use this feature ebay, paypal, myspace, etc...

I was wondering if anyone knows of a script that allows this or knows how i could do it? I need some way for an admin to be able to access the site while noone else can.

thanks!
Reply With Quote
  #2 (permalink)  
Old 03-23-04, 06:56 AM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
Well, you can inclue a main file in all your files that you want to be disabled...maby common.php, in that you can use an if statement...

if($sitedisable == 1) {
die('site is down...bla bla bla');
}

and for admin, well depends if you have the phpBB system it's simple...

if(!$userdata['session_logged_in'] && $userdata['user_level'] != ADMIN && $config['jorconfig_disable'] == 1 && !defined("IN_LOGIN"))

i used that for my project, it uses phpbb ;D, you are able to disable the whole site but all admins can view it... so if any modules are being changed right off the server they can work on it.
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Reply With Quote
  #3 (permalink)  
Old 03-23-04, 07:45 AM
Sargant Sargant is offline
Newbie Coder
 
Join Date: Mar 2004
Location: Wales
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
If you are running Apache with mod_rewrite, there is a way to do it with an .htaccess file in your root www directory. I did have a copy but it seems to have gone missing...
__________________
My Website: Sargant.Com
Noisebox, a simple but powerful shoutbox script
Reply With Quote
  #4 (permalink)  
Old 03-26-04, 11:01 PM
AvanteGuard AvanteGuard is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Infinite_Hackers
Well, you can inclue a main file in all your files that you want to be disabled...maby common.php, in that you can use an if statement...

if($sitedisable == 1) {
die('site is down...bla bla bla');
}

and for admin, well depends if you have the phpBB system it's simple...

if(!$userdata['session_logged_in'] && $userdata['user_level'] != ADMIN && $config['jorconfig_disable'] == 1 && !defined("IN_LOGIN"))

i used that for my project, it uses phpbb ;D, you are able to disable the whole site but all admins can view it... so if any modules are being changed right off the server they can work on it.
eh I wouldn't do that

try

if(($sitedisable) and (!$admin)) {
header("Location: blah.html");
}
__________________
Looking for Fast Professional Programming, Delivered ON TIME and at a great price? Then we're your team! Check us out at http://www.imadigan.com

ICQ: 314-942-262 / 111-638-053
MSN: matt@imadigan.com
Reply With Quote
  #5 (permalink)  
Old 03-26-04, 11:43 PM
Infinite_Hackers's Avatar
Infinite_Hackers Infinite_Hackers is offline
Coding Addict
 
Join Date: Dec 2003
Posts: 307
Thanks: 0
Thanked 0 Times in 0 Posts
What wouldn't you do?
__________________
New beta project: GFX-PRO.ATH.CX
Description: GFX-PRO a great new project that anyone can and setup in less then a minute. [ More info ]
Website: http://gfx-pro.ath.cx
Status: Online
http://gfx-pro.ath.cx/sig.png
Reply With Quote
  #6 (permalink)  
Old 03-27-04, 06:39 AM
01brclar 01brclar is offline
Newbie Coder
 
Join Date: Feb 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
I can help!

Quote:
Originally Posted by Myke311
I need to turn my site "off" for maintenance. Where if someone trys to load any page, they are redirected to a page that says the site is down for maintenance, will be back up shorty. A lot of message boards have this feature, a few websites use this feature ebay, paypal, myspace, etc...

I was wondering if anyone knows of a script that allows this or knows how i could do it? I need some way for an admin to be able to access the site while noone else can.

thanks!
I can help with this - I run 'Zap Programming' -Based in the UK - we specialise in custom based PHP scripts for companies around the world.

As it happens, we already have a script, created for another client that does this. If you are interested - please mail rclarke196@hotmail.com - For details - It is very reasonably priced as it not custom developed - probably around £5 / $10 (or via purchase on Amazon - multi currency!!) Let me konw anyway. Intereted? mail us

Just out of interst - Do you have MySQL? - There are 2 verisons - 1 runs w/ mysql and the other doesnt.
Reply With Quote
  #7 (permalink)  
Old 03-29-04, 08:06 AM
DA Master DA Master is offline
Wannabe Coder
 
Join Date: Jun 2003
Location: Yorkshire
Posts: 116
Thanks: 0
Thanked 0 Times in 0 Posts
I submitted this code to Snippet Library some time ago, you might find it useful...

http://www.snippetlibrary.com/viewhtml.php/6/25/516
__________________
PHP Code:

<?php if(PHP_OS == 'Windows') { echo "Doh"; } ?>

Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Accepting bids for hosting site re-design and ModernBill setup/integration SN-Coach Job Offers & Assistance 9 04-28-04 08:52 AM
Making the site of ur life ~SaraAnders~ The Lounge 10 04-18-04 11:04 AM
Too bad for webmaster who were stealing idea from another site - Look ! kevin PHP 3 02-18-04 11:24 AM
I developed a site .... Adi New Members & Introductions 3 08-23-03 11:02 AM
Does anyone know what type of script this site uses The Probuilder Script Requests 3 08-22-03 02:03 PM


All times are GMT -5. The time now is 10:20 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.