Тема: Как скачать трек который звучит в эфире
Искал но не нашел. есть скрипт который выводит трек на страницу. Но хотелось бы еще что б посетитель мог скачать этот трек
Сам скрипт
<script type="text/javascript">
<!--
function getcurentsong22744() {
var oXmlHttp = zXmlHttp.createRequest();
oXmlHttp.open("get", "getcurentsong22744.php", true);
oXmlHttp.onreadystatechange = function () {
if (oXmlHttp.readyState == 4) {
if (oXmlHttp.status == 200) {
displaycurentsong22744(oXmlHttp.responseText);
} else {
displaycurentsong22744("An error occurred: " + oXmlHttp.statusText);
}
}
};
oXmlHttp.send(null);
}
function displaycurentsong22744(sText) {
var divInfo = document.getElementById("curentsong22744");
divInfo.innerHTML = "В эфире: " + sText;
}
//-->
</script>
php исходник в файле
<?php
header("Content-Type: text/html; charset=windows-1251");
header("Cache-Control: no-cache");
header("Pragma: no-cache");
$curentsong22744="";
$curentsong22744=file_get_contents('http://info.radiostyle.ru/inc/getinfo.php?getcurentsong=22744&mount=hitnonstop');
if ($curentsong22744)
{
echo $curentsong22744;
}
else
{
$curl_curentsong22744 = curl_init();
curl_setopt($curl_curentsong22744, CURLOPT_RETURNTRANSFER, 1);
$url_curentsong22744 = 'ссылка и маунт ';
curl_setopt($curl_curentsong22744, CURLOPT_URL, $url_curentsong22744);
//curl_setopt($curl_curentsong22744, CURLOPT_HEADER,1);
$curentsong22744 = curl_exec($curl_curentsong22744);
echo $curentsong22744;
}
?>
ну и сам вывод
<!--//В эфире -->
<div id="curentsong22744" style="background-color:#C1D3FF;"></div>
обновление
<script type="text/javascript">
<!--
setInterval("getcurentsong22744();",10000);
//-->
</script>