Results 1 to 4 of 4

Thread: Site Down Script

  1. #1
    Join Date
    Feb 2008
    Posts
    12
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Site Down Script

    Hi,

    I was wondering if there was a script that would make my website redirect to another website if site #1 was down.

    Thanks

  2. #2
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    See this thread
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  3. #3
    Join Date
    Feb 2008
    Posts
    12
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    That thread refers to an Iframe hosted on his computer and another page hosted on the web. What about a page just hosted on the web?

    Thanks

  4. #4
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    I believe the thetestingsite's code should keep you going
    Code:
    <?php
     error_reporting(0);
    
     if (fsockopen("www.yoursite.com", 80, $errno, $errstr, 30)) {
       header('Location: http://www.yoursite.com/computer.html');
     }
     else {
       header('Location: http://www.other-site.com/page.html');
     } 
    ?>
    ...if nothing works, do post this in the PHP section...i'm not on my wits with regards to PHP
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  5. The Following User Says Thank You to rangana For This Useful Post:

    mvwebdesign (04-22-2008)

Bookmarks

Posting Permissions

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