Check a Port

By F*U*R*B*Y* on Nov 17, 2006

ok this is great to show your users what Services you have online. i'm currently using it for it to check my Website, my IRC Server and my Eggdrop. this is great, you just upload it, change the IP or anything else and its set to go

i've set it up for just IRC Server and Website. so its pretty good

and the two images are located here. ---- thats on.gif ---- thats off.gif


  $server  = "";
  $port   = "80";
  $port2   = "6667";
  $timeout = "10";

  if ($server and $port and $timeout) {
    $verbinding =  @fsockopen("$server", $port, $errno, $errstr, $timeout);
    $ircbinding =  @fsockopen("$server", $port2, $errno, $errstr, $timeout);
  if($verbinding) {
    echo "<img src='./images/on.gif'>Website is online<br>";
  else {
    echo "<img src='./images/off.gif'>Website is offline<br>";
  if($ircbinding) {
    echo "<img src='./images/on.gif'>IRC Server is online<br>";
  else {
    echo "<img src='./images/off.gif'>IRC Server is offline<br>";


Sign in to comment.
Yiorgos   -  Jan 26, 2012

This is very good and works like a charm. I am currently using it to monitor all my other services apart from the webpage :) thanks a bunch you saved me an hour today :)

Sargo Darya   -  Jun 17, 2010

Well, using it now to check if our game servers are up. Works like a charm dude.

Btw.: It's not a good idea to let this run everytime. Should be cached so it runs only every 5-10 minutes. Otherwise it will occupy your servers socket connections.

KuTsuM   -  Nov 19, 2006

\"Yoinx, if you have it on your Domain and thats not hosted off of your computer then no it won\'t show it online.\" is localhost no matter what system a server is hosted on and who is connecting to it..

F*U*R*B*Y*   -  Nov 19, 2006

any scores? :p

F*U*R*B*Y*   -  Nov 17, 2006

ok, i\'ve sort of done a bit of remodeling and i like how i have it, i\'ve gotten 2 pictures and i\'ll upload them to here for you guys if you want them. i\'ll edit the code to include them

Yoinx   -  Nov 17, 2006

If your website is down, wouldnt that sorta make that page not work to begin with?

Noutrious   -  Nov 17, 2006

Again, nice :)

Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.