Jump to content

FSockOpen Error


ajicles

Recommended Posts

I have  a remote shoutcast server and I was wonder if I could use an if statement to see if the server is offline or online. Except when its offline the script has to wait for it to time out then display an error message, which takes along time. So I want to check if it is online to return the online message and if not then it returns offline message.

 

Thanks

~AJ

 

 $fp = fsockopen("$server", $port, $errno, $errstr, 30);
if (!$fp) 
{
    echo "Offline";
}
else
{ 
echo "Online"; 
}

Link to comment
https://forums.phpfreaks.com/topic/207871-fsockopen-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.