|
|
#2 |
|
Moderator
Join Date: Apr 2000
Posts: 4,491
|
<?php
/****************************************************************** Am I off or online? Simple function to check if your SHOUTcast server has a source connected and is online. License, free, use like the wind blows. Be nice and recognize that it was written by Jay Krivanek of <a href="http://www.radiotoolbox.com" target="_blank">www.radiotoolbox.com</a> <img src="images/smilies/wink.gif" border="0" alt=""> ******************************************************************/ $host="24.57.242.197"; $port=8010; $wait_sec=2; $fp = fsockopen($host, $port, &$errstr, &$errno, $wait_sec); if ($fp) { fputs($fp, "GET / HTTP/1.0\r\nUser-Agent:AmIoffOrOn\r\n\r\n"); $ret = fgets($fp, 255); if (ereg("200", $ret)) { echo "Online"; } else { echo "Offline"; } fclose($fp); } else { echo "Offline"; } ?> |
|
|
|
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|