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
Question
jtssi
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
Â
Link to comment
Share on other sites
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 accountSign in
Already have an account? Sign in here.
Sign In Now