CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Disabling a site during maintenance

Print topic Send  topic

Author Message
jrp1946
Posted: 03/07/2002, 12:19 AM

Can anyone suggest a neat way of disabling a site, while displaying an appropriate explanation to users, during times when the site is being updated. I am working in ASP+HTML with Access tables. I don't mind if the entire site is disabled because we are only talking about a few minutes of downtime while, for example, an additional field is added to a database table, or an enhanced page is uploaded.
Alex Alexapolsky
Posted: 03/07/2002, 4:38 AM

Well you can put your code straight into Common event or
Global functions event , e.g.

if cn.execute("select status from maitainance").fields.item(0).value = "locked" then
response.write "<h1>Under construction</h1>"
response.end
end if
Brent
Posted: 03/07/2002, 7:32 AM

Or you could shutdown the db server for 10 seconds, copy the database to a
temporary directory using a simple Copy command in a batch file, and restart
the db server but now have the database readonly. Do the maintenance on the
database in the temporary directory, and then copy it back to the working
directory. Since it takes only a few seconds to copy the db files, the browser
shouldn't time out and the user won't be inconvenienced. You would display
a message on each updateable form when it first loads saying it is currently
read-only. In the Validation event you would check to see if the db is still
readonly and if it is, display a warning message to try again in 30 seconds. This
message automatically prevents the record from being updated.
Andrew B
Posted: 03/07/2002, 8:19 PM

I put a custom routine in the 'show any page' section of 'modules'. It goes something like this :

if (application("locked") = true) then
response.redirect "site_locked.asp"
end if

site_locked.asp displayes a simple 'site locked' error message with some pretty graphics and whatever custom stuff I put in my 'set lockout' page.

The I make a special directory called /lockout or something (not tellin u what i use!) and put a few really really simple asp files in there to lock it and unlock it. I also usually do something with downtime and expected uptime, but that depends on the site. You do need to custom code the 'this site is locked out' page, since if it is in CC then you will enter a nice little infinite loop.

/lockout/lock.asp
<% application("locked") = true
response.redirect "default.asp"
%>

/lockout/unlock.asp
<% application("locked") = false
response.redirect "default.asp"
%>

/lockout/default.asp
Application is :
<% if (application("locked") = true) then
response.write "locked"
else
response.write "unlocked"
end if
%>
<br>
<a href="lock.asp">Lock Site</a>
<a href="unlock.asp">Unlock Site</a>

---

Those are off the cuff, so they might not work perfectly. But you get the idea.

I can send you a more complete example if you want.
backer_a@hotmail.com

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.