Jump to content
xisto Community
Mistikpso

Server Status MAke Your own server status in PHP

Recommended Posts

My Friend and i made an mmorpg we decided to make a code so the users could tell when the game server was running

this codoe has many other uses to like monitor a website or w/e you want to do.

<? $ip = "youriphere"; $port = "yourporthere"; if (! $sock = @fsockopen($ip, $port, $num, $error, 5)) echo '<B><FONT COLOR=red>Offline</b></FONT>'; else{ echo '<B><FONT COLOR=lime>Online</b></FONT>'; fclose($sock); } ?>

-open a text editor like notepad
-Put this code in your <Body> of index.html or w/e page you are using
-after you finish adding the code make sure you set the port and IP
-and when you add all the data save your file as index.php
-upload the file
-Finished ~ your server status is set ~
Edited by Mistikpso (see edit history)

Share this post


Link to post
Share on other sites

Very nice tutorial, I've been looking for a script like this to monotor my Wolfenstein Enemy Teritory game servers, and put some information about it on my Xisto website (I run a clan)...

Notice from snlildude87:
Seriously, did you have to quote the entire post? When there are no quotes, it's understood that you're replying to the first post in the thread.
Edited by snlildude87 (see edit history)

Share this post


Link to post
Share on other sites

I agree it is an easy but useful script. However i could not watch your script in action. It seems your link is a broken one.

Notice from snlildude87:
Seriously, did you have to quote the entire post? When there are no quotes, it's understood that you're replying to the first post in the thread.
Edited by snlildude87 (see edit history)

Share this post


Link to post
Share on other sites

hmmm not bad of a scriptm could be useful on alot of gaming servers. kudos

Share this post


Link to post
Share on other sites

Nice script, I also made a slight change for anyone who wants it.

If you are are hosted on Xisto and you have an upload module that uses FTP you can modify this to check if the uploader will work by setting using these settings.
$ip = "69.50.188.18";
$port = "21";

So your overall-all script would be

<html><body><?php$ip = "69.50.188.18";$port = "21";if (! $sock = @fsockopen($ip, $port, $num, $error, 5))echo '<div align="center">The upload is <font color=red><b>Offline</b></FONT></div><br><br>';else{echo '<div align="center">The upload is: <font color=green><b>Online</b></FONT></div><br><br>';fclose($sock);} ?></body></html>

Share this post


Link to post
Share on other sites

Okay well the link for hte demo didnt work for me, and when i tried to do it my slef, nothing loaded. Im not the best at this tuff and probally did it wrong but i thought ide let you know! seems liek an aweomse script tho!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.