Jump to content
  • 0

Script that check if server is Online or offline ?


Question

5 answers to this question

Recommended Posts

  • 0
Posted

<?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.

  • 0
Posted

<?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?

  • 0
Posted

working on u? not working for me

 

mayeb i add it on wrong place?

Is it returning any errors?

 

Where did you add it exactly?

Guest
This topic is now closed to further replies.


×
×
  • 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 Disabled AdBlock