Jump to content

question about turning a website on and off


stelthius

Recommended Posts

Hello everyone,

 

i just want to know what language should i use to enable or disable my website, this is a new task for me but im unsure what language it would be coded in to do it, if anyone has used vbulletin you'll know what i mean by turning it on and off.

 

 

Rick

There's a million ways to implement something like that, depending on what your "website" is.  But it basically boils down to a simple condition:

 

$sitestatus = 0; // random variable name. 1 = 1, 0 = off

if($sitestatus == 0) { 
  // echo site is 'turned off' message
} else {
   // display page or do whatever 
}

 

You would have a hardcoded variable or a value in a column in a database or something in a flatfile or whatever.  1 = on, 0 = off.  Then it's a simple matter of checking whether the variable is 1 or 0.  You can do that in any language meant for "websites".

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.