Hello & Welcome to our community. Is this your first visit? Register
Follow us on
Follow us on Facebook Follow us on Twitter Watch us on YouTube


MMOCoin

Likes Likes:  0
Results 1 to 2 of 2
  1. #1
    Beginner

    Join Date
    Dec 2010
    Posts
    1
    Post Thanks / Like
    Rep Power
    14
    Reputation
    1

    Cool How to make a simple php script to show server status.


    Register to remove this ad
    I'm a noob to php, but I wanted to post my limited knowledge to help others out. If the code is crap, let me know what I did wrong, but I've tested it and it works for me.

    How to make a simple php script to show server status if you don't have a ready-made public server website with the server status feature included.

    First, make 2 icons showing "offline" and "online" status respectively. It is best to make these icons the exact same dimensions. Example: 20pixels x 20pixels
    Name the files "serveron.gif" and "serveroff.gif" (you don't have to use a .gif, you can use a .jpg, .png, etc.)

    Create a new folder named "serverstatus" or something similar. Put your 2 icons that you created into the folder. Then, create a file within the folder named "online.php" or something similar.

    Copy/paste this code into the file.

    Code:
    $ip = "yoursite.com";
    $onlinetext = "Server is On-Line" ;
    $offlinetext = "Server is Off-Line" ;
    $port = "80";
    
    if(@fsockopen($ip,$port,$errno,$errstr,1)) {
    echo"<a href='http://$ip' rel="nofollow" target='_blank'><img src='serveron.gif' width='20' height='20' border='0'></a>  $onlinetext";
    } else {
    echo"<img src='serveroff.gif' width='20' height='20' border='0'> $offlinetext";
    }
    ?>
    Replace "yoursite.com" with the url or ip address of the server.

    Customize the "Server is On-line" and "Server is Off-line" messages to your liking.

    Enter the correct port # (if unsure, leave at "80")

    Save the file, and upload the folder to your host. Example: "www.yoursite.com/serverstatus/online.php".

    Navigate to the url where you put your "online.php" file ie. "www.yoursite.com/serverstatus/online.php" and see it working!

    To link to the php file from your web page, copy/paste the code below where you would like the status to be located in your web page.

    Code:
    <script><script language="JavaScript" type="text/javascript"
    src="http://yoursite.com/serverstatus/online.php"</script>
    Replace "http://yoursite.com/serverstatus/online.php" with the location of the server status php file you created.

    Save the file, and upload it.

    That's it! You now have a live server status message with cool icons that you made all by yourself!


    › See More: How to make a simple php script to show server status.

  2. #2
    Grunt
    id820's Avatar
    Join Date
    Sep 2009
    Location
    Brazil
    Posts
    42
    Post Thanks / Like
    Rep Power
    16
    Reputation
    36

    Register to remove this ad
    You should link a demo for us, looks good anyway, im not sure if it works cuz i dont know php hehe.

    http://www.id820.com - GraphicDesigner



  3. Related Threads - Scroll Down after related threads if you are only interested to view replies for above post/thread

 

 

Visitors found this page by searching for:

php script server status

server status php script

trinity server status script

Show server status php

how to make a server status page

trinity server status

php script for server status

php server status script

trinity php scripts

PHP SHOW status

simple php server status script

server status script

trinity status script

display server status php

php script to show server status

wow server status script

php display server status

live server status script

simple php server statushow to make a server statusshow php statusphp script show server statusscript php server statusserver status script phpTrinity server status PHPhow to create status in phpserver status script trinityscripts server statusscript to show server statusphp server status iconcreate a server status pagehow to make a server status iconserveron.gifphp show server statshow to show status in phpshow status in phpscript statut serveur trinityserver status php codehow to make a status phpphp server uptime scriptstatus page phpHow to show server live statusscript statut serveurhow to make server status with phpserver status online scripthow make statuttrinity php server statustrinity online scripthow to make a status.php pagemake a simple status script php
SEO Blog

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -5. The time now is 12:34 PM.
Powered by vBulletin® Copyright ©2000-2024, Jelsoft Enterprises Ltd.
See More links by ForumSetup.net. Feedback Buttons provided by Advanced Post Thanks / Like (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
vBulletin Licensed to: MMOPro.org