+ Reply to Thread
Results 1 to 10 of 10

Thread: Online/Offline

  1. #1
    sk1tL1L is offline x10Hosting Member sk1tL1L is an unknown quantity at this point
    Join Date
    Aug 2006
    Posts
    59

    Online/Offline

    hey Guys,
    i've got my own admin panel for my site. And i was wondering if theres a script i can get if services are offline/online.
    Eg.
    HTTP: Online!
    FTP: Offline

    It will be great if you have one of these.

    Cheers
    sk1tL1L

  2. #2
    Fedlerner's Avatar
    Fedlerner is offline Retired Fedlerner is an unknown quantity at this point
    Join Date
    Aug 2006
    Location
    Buenos Aires, Argentina
    Posts
    12,923

    Re: Online/OfflineH

    You can use the images of this thread: http://forums.x10hosting.com/showthread.php?t=13706
    Federico Lerner
    Former x10Hosting Administrator - Staff Manager

  3. #3
    sk1tL1L is offline x10Hosting Member sk1tL1L is an unknown quantity at this point
    Join Date
    Aug 2006
    Posts
    59

    Re: Online/OfflineH

    but is there a script? Thats what i'm really looking for
    sk1tL1L

  4. #4
    lambada's Avatar
    lambada is offline x10 Elder lambada is an unknown quantity at this point
    Join Date
    Mar 2006
    Location
    Caister, Gt Yarmouth, Norfolk, ENGLAND
    Posts
    1,222

    Re: Online/OfflineH

    This seems to be along the lines of what you want:

    http://www.schwebdesigns.com/serverstatus/
    Lambada - the former Account Manager (before I resigned)




  5. #5
    sk1tL1L is offline x10Hosting Member sk1tL1L is an unknown quantity at this point
    Join Date
    Aug 2006
    Posts
    59

    Re: Online/OfflineH

    ill talk alook, thanks
    sk1tL1L

  6. #6
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Re: Online/OfflineH

    Use this:
    PHP Code:
    <?php

    function serviceStatus(66.232.109.231$port) {
       
    $handle = @fsockopen($ip$port$errno$errstr30);
       if (!
    $handle) {
          
    $string 'Down';
       } else {
          
    $string 'Online';
          @
    fclose($handle);
       }
       return 
    $string;
    }

    echo 
    $string;

    ?>
    Change $port to a port, and change Online and Offline to w/e you want, use HTML code here too;)
    Last edited by Brandon; 12-07-2006 at 06:07 PM.
    Thanks,
    Brandon Long

  7. #7
    Fedlerner's Avatar
    Fedlerner is offline Retired Fedlerner is an unknown quantity at this point
    Join Date
    Aug 2006
    Location
    Buenos Aires, Argentina
    Posts
    12,923

    Re: Online/Offline

    I changed the $port to the port 80 (HTTP) and i'm getting this error:
    Code:
    Parse error: syntax error, unexpected T_DNUMBER, expecting '&' or T_VARIABLE in /home/fedlerne/public_html/x10/includes/status.php on line 3
    Federico Lerner
    Former x10Hosting Administrator - Staff Manager

  8. #8
    Torch's Avatar
    Torch is offline x10 Lieutenant Torch is an unknown quantity at this point
    Join Date
    Apr 2006
    Location
    Belgrade, Serbia
    Posts
    317

    Re: Online/Offline

    You have to use that function like this:
    PHP Code:
    <?php
    function serviceStatus($ip "66.232.109.231"$port 80){
       
    $handle = @fsockopen($ip$port$errno$errstr30);
       if (!
    $handle) {
          
    $string 'Down';
       } else {
          
    $string 'Online';
          @
    fclose($handle);
       }
       return 
    $string;
    }

    echo 
    serviceStatus();
    ?>
    The $ip and $port vars in the function are the default ones, but you can override them by setting them in function call eg.:
    PHP Code:
    echo serviceStatus("123.123.123.123",8080); 

  9. #9
    Fedlerner's Avatar
    Fedlerner is offline Retired Fedlerner is an unknown quantity at this point
    Join Date
    Aug 2006
    Location
    Buenos Aires, Argentina
    Posts
    12,923

    Re: Online/Offline

    Thanks Torch!
    That worked
    Federico Lerner
    Former x10Hosting Administrator - Staff Manager

  10. #10
    Brandon's Avatar
    Brandon is offline Former Senior Account Rep Brandon is on a distinguished road
    Join Date
    Jun 2006
    Location
    Tewksbury, MA
    Posts
    9,589

    Re: Online/Offline

    Thatnks Torch, i was busy doing other things posting and forgot it was a function.
    Thanks,
    Brandon Long

+ Reply to Thread

Similar Threads

  1. Online/Offline
    By HabboHaze in forum Free Hosting
    Replies: 8
    Last Post: 10-20-2006, 05:41 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers