PHP script in on a website to check if a game server is up or down.

So I’ve been hosting a game server for some people I know, and since it’s somewhat new and not very mainstream, there aren’t any server status sites up yet.

Since I’d like to be able to let the people on my forum know if my server is up or not, I was trying to host a PHP script on a separate website I own, which would do the following:

1.) Ping my server’s IP and port to see if it was online.

2.) There would be 2 PNG images hosted on my website, one denoting that the server is up, and one denoting that the server is down.

3.) Somehow, the PHP script would update the image depending on the server’s status.

Now, I know this is possible, simply because I’ve seen it done countless times on forums signatures for other games and servers (the same way I’ve seen signatures tell me my IP).

Would anyone have prior knowledge of doing this and/or let me know how or where to get started? I really don’t have that much prior experience with PHP or it’s HTML applications, but I would greatly appreciate some help.

Its possible, but you wouldn’t want to rely on the ping to tell you if the server is up or down. The rest is easy to do.

Sponsor our Newsletter | Privacy Policy | Terms of Service