ajicles Posted July 15, 2010 Share Posted July 15, 2010 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.