Jump to content
  • 0

Question

Posted

Hello, I'm looking for a way via my website to display the status of the server whether it is online or not. On the internet I found code vouchers but it doesn't work:

 

<?php
$debug = true;
$site = 'udp://xxx.xxx.xxx.xxx';
$port = '5400';
$check = fsockopen( $site, $port, $errno, $errstr, 6 );
if ( ! $check ) {
   if($debug){
      echo "Error #$errno : $errstr <br>";
   }
   echo 'Offline';     
}
else {
   echo 'Online';
}

?>

whether I put one port or the other it always tells me online

thank you for your help

 

1 answer to this question

Recommended Posts

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