Register for your free account! | Forgot your password?

You last visited: Today at 01:49

  • Please register to post and access all features, it's quick, easy and FREE!

 

Server Status

Reply
 
Old   #1
 
elite*gold: 0
Join Date: May 2013
Posts: 43
Received Thanks: 1
Server Status

Hi! I was just wondering how to add a server status to a site.

I would want it like this

Log In: ON (or if it's off) OFF

Rappelz Server: ON (or if it's off) OFF
Teampeak: ON (or if it's off) OFF



Pyrochina is offline  
Old   #2
 
elite*gold: 0
Join Date: Jul 2011
Posts: 111
Received Thanks: 85
Something like this ?

Code:
<?php

$ip= "127.0.0.1"; //Server IP
$port= "6686"; //Server Port

@$fp = fsockopen ($ip ,$port , $errno, $errstr, 1);
if (!$fp)
echo '<b>Server:<font color="#FF0000"><b> Offline</b></font></b>';

else
echo '<b>Server:<font color="#008000"><b> Online</b></font></b>';

?>


Ne0@NCarbon is offline  
Old   #3
 
elite*gold: 0
Join Date: May 2013
Posts: 43
Received Thanks: 1
Yes but that works...
Pyrochina is offline  
Old   #4
 
elite*gold: 0
Join Date: Apr 2012
Posts: 448
Received Thanks: 766
You don't have to close $fp ? If it's not done automatically, you will have a bunch of opened connection to the game server never closed especially if many people use this web page. (even if the server will close them after a while)

(using fclose($fp) when online )


glandu2 is offline  
Old   #5
 
elite*gold: 0
Join Date: Jun 2013
Posts: 31
Received Thanks: 3
Pyrochina... I gave you my skype by PM I'll give you the codes to an old site I coded. You can see some functions and others. Also, you can also try to use online tutorials to help you learn more
Dyson49 is offline  
Old   #6
 
elite*gold: 0
Join Date: Jun 2013
Posts: 4
Received Thanks: 0
@Ne0 :
Code:
<?php

$ip= "127.0.0.1"; //Server IP
$port= "6686"; //Server Port

@$fp = fsockopen ($ip ,$port , $errno, $errstr, 1);
if (!$fp){
     echo '<b>Server:<font color="#FF0000"><b> Offline</b></font></b>';
     fclose($fp);
}
else
     echo '<b>Server:<font color="#008000"><b> Online</b></font></b>';

?>
you still have the handle active on socket


neaw is offline  
Reply



« Previous Thread | Next Thread »

Similar Threads
Reg Page Edited Server Status + Extra Status
This is a new realease of the reg page created by Xsense Download XAMP apache friends - xampp for windows Reg Page Files (By Tazdingo And...
22 Replies - SRO Coding Corner
[Server Status] Server Status Programs From A Couple Servers.
Hey i dont know in what section to post it so i hope that the mods will move it to the good section but i made this server status program i will make...
9 Replies - CO2 Main - Discussions / Questions



All times are GMT +2. The time now is 01:49.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2017 elitepvpers All Rights Reserved.