stelthius Posted December 16, 2008 Share Posted December 16, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/137226-question-about-turning-a-website-on-and-off/ Share on other sites More sharing options...
Daniel0 Posted December 16, 2008 Share Posted December 16, 2008 In the same language you are programming the rest of your site it. It's a simple conditional statement you need to do. Quote Link to comment https://forums.phpfreaks.com/topic/137226-question-about-turning-a-website-on-and-off/#findComment-716875 Share on other sites More sharing options...
stelthius Posted December 16, 2008 Author Share Posted December 16, 2008 Ahhh ok kool, well im using php so im gonna read up on that hopefully find something helpfull thank you Quote Link to comment https://forums.phpfreaks.com/topic/137226-question-about-turning-a-website-on-and-off/#findComment-716881 Share on other sites More sharing options...
.josh Posted December 16, 2008 Share Posted December 16, 2008 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". Quote Link to comment https://forums.phpfreaks.com/topic/137226-question-about-turning-a-website-on-and-off/#findComment-716882 Share on other sites More sharing options...
waynew Posted December 17, 2008 Share Posted December 17, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/137226-question-about-turning-a-website-on-and-off/#findComment-717716 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.