Author Topic: question about turning a website on and off  (Read 305 times)

0 Members and 1 Guest are viewing this topic.

Offline stelthiusTopic starter

  • Enthusiast
  • Posts: 275
    • View Profile
    • http://www.speedtest.net/result/218606217.png
question about turning a website on and off
« on: December 16, 2008, 01:29:44 PM »
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

Offline Daniel0

  • Administrator
  • 'Insane!'
  • *
  • Posts: 11,815
  • Gender: Male
  • ^bb|[^b]{2}$
    • View Profile
Re: question about turning a website on and off
« Reply #1 on: December 16, 2008, 01:44:36 PM »
In the same language you are programming the rest of your site it. It's a simple conditional statement you need to do.

Offline stelthiusTopic starter

  • Enthusiast
  • Posts: 275
    • View Profile
    • http://www.speedtest.net/result/218606217.png
Re: question about turning a website on and off
« Reply #2 on: December 16, 2008, 01:48:33 PM »
Ahhh ok kool, well im using php so im gonna read up on that :) hopefully find something helpfull :)  thank you

Offline .josh

  • Administrator
  • 'Insane!'
  • *
  • Posts: 13,161
  • Grumpy Old Man
    • View Profile
Re: question about turning a website on and off
« Reply #3 on: December 16, 2008, 01:48:58 PM »
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".

Did I help you? Feeling generous? Donate to me! | Donate to phpfreaks!

Offline waynewex

  • Addict
  • Posts: 2,364
  • Gender: Male
    • View Profile
    • Web Design Wexford
Re: question about turning a website on and off
« Reply #4 on: December 17, 2008, 09:17:06 AM »
With every site I make, I always include a master file in each page, so that things like this can be sorted out pretty quickly. You can't imagine how many times this has proven to be useful.