如何为shoutcast服务器提供一个简单的php页面?

我在php/Ajax编码方面是新手。我正在使用这个站点上的一个免费脚本为shoutcast服务器提供一个简单的php页面,来显示播放的歌曲。

<?php
    
        require_once "inc.php";
    
    $array = array(); // Let's store our shoutcast variables into an array.
    
    $array['host'] = "xxx.xxx.xx.xxx"; // Your Shoutcast Host
    $array['port'] = "xxxx"; // Your Shoutcast Port
    $array['extra'] = "/admin.cgi?sid=1&mode=viewxml&page=1"; // The bit that follows in the url to access the xml of the stats
    $array['user'] = "xxxxx"; // Admin username (Default is usually "admin")
    $array['password'] = "xxxxxxx"; // Admin Password
    
    $radioStats = new radioStats( $array['host'], $array['port'], $array['extra'], $array['user'], $array['password']);
     
    $returnStats = $radioStats->returnStats(); 
    $song = $returnStats['currentSong'];
     ?>
<div align="center">
 <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
 </script>
<link href="votingfiles/voting.css" rel="stylesheet" type="text/css" />
<script src="votingfiles/voting.js" type="text/javascript"></script>
 <script>
 $(document).ready(function(){
 setInterval(function(){cache_clear()},54000);
 });
 function cache_clear()
{
 window.location.reload(true);
}
</script>             
    <div id="radio_stats">

    <?php
        
        if( $returnStats['serverStatus'] != 0 ) {
        
    ?>
        <?php
        if( $returnStats['currentSong'] != "" ) {
            echo $returnStats['currentSong'];
        } else {
            echo "Undefined";
        }
        ?></div>
    
        <br /><br />
                <div class="vot_updown1" id="vt_$song"></div>   
    <?php
        }
        else {
    ?>
    This radio server appears to be offline.
    <?php
        }
    ?>

我的问题是:按理来说所有Php / ajax / mysql请求都可以,但是实际上当我vote时,它在db中的注册方式如下:

vt_$song 1 0

我该如何获取歌曲的真实名称,如原始php请求那样:

echo $returnStats['currentSong']; or echo $song;

要在数据库中注册,例如:

vt_Kidd Guti-Step Everything 1 0 (or any other song played)

多谢帮助!

In this line the $song is not parsed as PHP so the literal text $song is showing:

<div class="vot_updown1" id="vt_$song"></div>

Try:

<div class="vot_updown1" id="vt_<?php echo $song; ?>"></div>