Results 1 to 10 of 10

Thread: Site open/close

  1. #1
    Join Date
    Feb 2007
    Posts
    2,941
    Tokens
    0

    Latest Awards:

    Default Site open/close

    If possible could someone get me a script to open/close a site eg when i click a link saying close it will redirect to another page then when i clcik open it will then go back to my normal home page

    + rep will be givven

    Moved by nvrspk4 (Assistant General Manager) from Designing and Development. Please post in the correct forum.
    Last edited by nvrspk4; 08-01-2008 at 06:01 AM.

  2. #2
    Join Date
    Sep 2007
    Location
    USA
    Posts
    474
    Tokens
    0

    Default

    personally i would do ip ban with redirect
    where when on it goes to page when on maitence it gives edited bann screen to blank then redirects to a maitence page you set in another directory

    this should help if your looking for another way
    http://www.webmasterworld.com/forum92/3204.htm
    Post Meter
    ______________________________________________
    400 450 500 550 600 650 700 750 800 850 900-1k
    Green=Done | Orange=Almost | Red=Not Done
    ______________________________________________
    Habbo fury Coming Soon!
    My Img tag has ran away

  3. #3
    Join Date
    Dec 2007
    Posts
    412
    Tokens
    0

    Default

    Quote Originally Posted by LegendOfNoob View Post
    personally i would do ip ban with redirect
    where when on it goes to page when on maitence it gives edited bann screen to blank then redirects to a maitence page you set in another directory

    this should help if your looking for another way
    http://www.webmasterworld.com/forum92/3204.htm
    Why would you do an IP Ban to put a site on maintenance, lol? I think you don't understand what he means.

    Just a basic database with 'closed'. Then make a script and if it's 'closed', you direct to a maintenance page else (nothing lol).

    Then put a drop-down on a button on a password protected page called Close / Unclose for example and it would just update your database.

    I would write something out but I'm a bit busy atm, sorry.

  4. #4
    Join Date
    Jul 2005
    Location
    Belgium
    Posts
    2,492
    Tokens
    147

    Latest Awards:

    Default

    In my TemplateNation system, I've got a maintenance option (well admins have).

    And basicly it uses mysql so i have a db called maintenance, in which I've got a record set to 'no' and a form to set to yes/no etc etc.

    Then on my index.php I've got the ?page= navigation so I did this:

    PHP Code:

    if($sql["maintenance"] == "no"){
    //php nav system
    }else{
    //display maintenance page

    (I also added something so that maintenance doesn't affect admins)

    If thats what's you want, pm me
    Last edited by [Oli]; 07-01-2008 at 08:39 PM.

  5. #5
    Join Date
    Feb 2007
    Posts
    2,941
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by [oli] View Post
    In my TemplateNation system, I've got a maintenance option (well admins have).

    And basicly it uses mysql so i have a db called maintenance, in which I've got a record set to 'no' and a form to set to yes/no etc etc.

    Then on my index.php I've got the ?page= navigation so I did this:

    PHP Code:
     
    if($sql["maintenance"] == "no"){
    //php nav system
    }else{
    //display maintenance page

    (I also added something so that maintenance doesn't affect admins)

    If thats what's you want, pm me
    yep got it exacly i will pm

  6. #6
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    Providing you know PHP, i've always done $siteoffline = yes/no; in globals.php or settings.php or whatever, and then had in your header.php file and if statement regarding wether it is a yes, if so kill ur script with die() or kill() both the same I believe, and something like kill(Site is offline) die(Site is offline)
    Now i'm not an amazing php'r so umm verify this with someone better first.
    How could this hapen to meeeeeeeeeeeeeee?lol.

  7. #7
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    Code:
    <?php
    
    if (isset($_POST['site'])){
         
         $site = $_POST['site'];     
         if ($site == 'on'){
         }else{
         die('Sorry the webpage is closed.');
         }
    }else{
    
    echo("<form>
    <option value='on' name='on' /><br />
    <option value-'off' name='off' /><br />
    <input type='submit' name='site' value='Choose' /></form>");
    }
    ?>
    That should work, not tested.
    Last edited by Mr Macro; 14-01-2008 at 08:59 PM.
    James


    Connected to reality through a proxy server.

  8. #8
    Join Date
    Apr 2006
    Location
    Leamington Spa
    Posts
    1,375
    Tokens
    72

    Latest Awards:

    Default

    I think there's something like this in the Web Tutorials.
    If there isn't, PM me and I'd be more than happy to make something for you.
    i've been here for over 8 years and i don't know why

  9. #9

    Default

    Quote Originally Posted by Mr Macro View Post
    Code:
    <?php
    
    if (isset($_POST['site'])){
         
         $site = $_POST['site'];     
         if ($site == 'on'){
         }else{
         die('Sorry the webpage is closed.');
         }
    }else{
    
    echo("<form>
    <option value='on' name='on' /><br />
    <option value-'off' name='off' /><br />
    <input type='submit' name='site' value='Choose' /></form>");
    }
    ?>
    That should work, not tested.
    LOL? that will only display the message for that instance, when the form is submitted, you need to use mysql to insert a value into the database and call the value to see if it's open/closed and then display the site or maintainence page. I posted a tutorial about this on chf, but it doens't let me post tutorials on here for some wierd reason so i can't post it on here.

  10. #10
    Join Date
    Jan 2007
    Posts
    651
    Tokens
    0

    Default

    Oh yeah, i just though ot that Lmao made my self look a bit of a **** there i think lol.
    James


    Connected to reality through a proxy server.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •