I have shoutcast administrator and i need to read xml from that it looks like this
http://SHOUTCAST-IP:PORT/admin.cgi
And i need to login and get the XML Data from http://SHOUTCAST-IP:PORT/admin.cgi?mode=viewxml and do it with php, i have made this script
$fp = fsockopen($server, $port, $errno, $errstr, 30);
fputs($fp, "GET /admin.cgi?pass=".$password."&mode=viewxml HTTP/1.0\r\nUser-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 5.0)\r\n\r\n"); //
while (!feof($fp)) {
$content = fgets($fp);
}
But it doesn't work, it says Unauthorised
. How can i fix it ?
What about this?