Script-PHP-Shoutcast-Display song history

by Digital in Tutoriais on Maio 15, 2019

Shows the song history in a table, in the same format as played.html

<?php

$server_ip = “YOUR SERVER ADDRESS”;
$portbase = “YOUR SERVER PORT”;

if (!is_numeric($portbase)) {
print “Invalid port”;
exit;
}
$fp = @fsockopen($server_ip,$portbase,$errno,$errstr,1);
if (!$fp) {
print “<p>Connection refused, the server appears to be offline.</p>”;
exit;
} else {
fputs($fp, “GET /played.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n”);
while (!feof($fp)) {
$info = fgets($fp);
}
$content = get_string_between($info, “Admin Login</a></font></td></tr></table></td></tr></table><br>”, “<br><br><table”);
print $content;
fclose($fp);
}

function get_string_between($string, $start, $end) {
$string = ” ” . $string;
$ini = strpos($string, $start);
if ($ini == 0)
return “”;
$ini += strlen($start);
$len = strpos($string, $end, $ini) – $ini;
return substr($string, $ini, $len);
}
?>

Express Your Reaction
Like
Love
Haha
Wow
Sad
Angry
You have reacted on "Script-PHP-Shoutcast-Display song history" A few seconds ago

Categories: Tutoriais

Tags:

Latest Product

Share Your Valuable Opinions