Jump to content
  • 0

Script that check if server is Online or offline ?


GsL
 Share

Question

5 answers to this question

Recommended Posts

  • 0

<?php
error_reporting(0);
function check($ip, $port) {
   if (fsockopen($ip, $port, $errno, $errstr, 1)) return "Online";
   else return "Offline";
}
echo "LoginServer: ";
echo check("127.0.0.1", "2106");
echo "<br/>GameServer: ";
echo check("127.0.0.1", "7777");
?>

 

Try that.

Link to comment
Share on other sites

  • 0

<?php
error_reporting(0);
function check($ip, $port) {
   if (fsockopen($ip, $port, $errno, $errstr, 1)) return "Online";
   else return "Offline";
}
echo "LoginServer: ";
echo check("127.0.0.1", "2106");
echo "<br/>GameServer: ";
echo check("127.0.0.1", "7777");
?>

 

Try that.

 

working on u? not working for me

 

mayeb i add it on wrong place?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share



×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disbaled AdBlock