Thread: [PHP] Server Status

Results 1 to 9 of 9
  1. #1 [PHP] Server Status 
    Cash Back Guaranteed!


    Join Date
    Sep 2012
    Age
    29
    Posts
    246
    Thanks given
    36
    Thanks received
    42
    Rep Power
    164
    This is really simple.

    Now this is the code Just change add your IP and port if necessary.
    Code:
    <?php
    function status() {
    	$ip="Server IP";
    	$port="43594";
    	if(!$sock=@fsockopen($ip,"$port", $num, $error, 5)) {
    		echo('Offline');
    	} else {
    		echo('Online');
    	}
    }
    ?>
    <html>
    <body>
    
    <?php
    status();
    ?>
    
    </body>
    </html>
    Spoiler for Rune Plus:
     

  2. #2  



    Join Date
    Dec 2010
    Posts
    833
    Thanks given
    261
    Thanks received
    121
    Rep Power
    204
    Already been released on this section.
     

  3. #3  
    Hostingtowers.org

    Join Date
    Dec 2011
    Posts
    178
    Thanks given
    27
    Thanks received
    6
    Rep Power
    0
    Just added it thanks, now how would I colour the online or offline? So say I want the online to be green and the offline to be red. Also, how would I change the font size...
     

  4. #4  
    Cash Back Guaranteed!


    Join Date
    Sep 2012
    Age
    29
    Posts
    246
    Thanks given
    36
    Thanks received
    42
    Rep Power
    164
    echo('The server is <font color="red"> Offline');
    } else {
    echo('The server is <font color="green"> Online');
    }
    Spoiler for Rune Plus:
     

  5. Thankful user:


  6. #5  
    Hostingtowers.org

    Join Date
    Dec 2011
    Posts
    178
    Thanks given
    27
    Thanks received
    6
    Rep Power
    0
    Dawn,

    This is my code, yet when I add any random server ip the word online won't change. I tried random offline servers but it still said 'online'...

    <?php
    function status() {
    $ip="208.64.120.82";
    $port="43594";
    if(!$sock=@fsockopen($ip,"$port", $num, $error, 5)) {
    echo('<b><font color="cyan"><font size=14>The server is</b></font></font> <font color="orange"><font size=18>Online</font>');
    } else {
    echo('<b><font color="cyan"><font size=14>The server is</b></font></font> <font color="red"><font size=18>Offline</font>');
    }
    }
    ?>
     

  7. #6  
    CodexBot


    Join Date
    Sep 2011
    Age
    30
    Posts
    884
    Thanks given
    136
    Thanks received
    153
    Rep Power
    148
    Awesome1 you should make a help thread & nice release.
    - CodexBot
     

  8. Thankful user:


  9. #7  
    Registered Member TheAmmoBandit's Avatar
    Join Date
    Nov 2011
    Posts
    168
    Thanks given
    18
    Thanks received
    26
    Rep Power
    2
    Already done by my but nice post, btw awesome try this,

    Code:
    <?php
    function status() {
    $ip="208.64.120.82";
    $port="43594";
    if(!$sock=@fsockopen("$ip", $port, $num, $error, 5)) {
    echo('<b><font color="cyan" size=14>The server is</b></font> <font color="orange" size=18>Online</font>');
    } else {
    echo('<b><font color="cyan" size=14>The server is</b></font> <font color="red" size=18>Offline</font>');
    }
    }
    ?>
     

  10. #8  
    Registered Member
    Anthony`'s Avatar
    Join Date
    Sep 2008
    Age
    29
    Posts
    763
    Thanks given
    75
    Thanks received
    164
    Rep Power
    204
    I don't understand why we need more of these. Stop, search around for the ones that are already here, and modify it for yourself. The last thing this section needs is more "server status checkers".
     

  11. #9  
    Registered Member
    Joker's Avatar
    Join Date
    Nov 2009
    Age
    28
    Posts
    1,845
    Thanks given
    378
    Thanks received
    1,206
    Rep Power
    5000
    Released multiple times already.

     

  12. Thankful users:



Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [PHP] Server Status Checker
    By Singod09 in forum Website Development
    Replies: 13
    Last Post: 05-22-2012, 04:12 AM
  2. [PHP/vB] Server Status
    By Z in forum Tutorials
    Replies: 7
    Last Post: 07-30-2010, 09:45 PM
  3. [PHP] Server Status Signature [PHP]
    By Naab in forum Website Development
    Replies: 21
    Last Post: 10-22-2009, 06:54 PM
  4. [PHP] vBulletin Server Status
    By Z in forum Application Development
    Replies: 6
    Last Post: 07-13-2009, 08:08 AM
  5. [PHP]Server status - Extended
    By funkE in forum Application Development
    Replies: 27
    Last Post: 04-23-2009, 01:26 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •