title: php/ajax vote up down
body: <p>and sry in advance because i'm new here and i'm completly new in php/ajax coding.</p>
  
  <p>I use a free script (Ajax vote up/down) from <a href="http://coursesweb.net/php-mysql/voting-up-down-script-ajax_s2" rel="nofollow">this site</a></p>
  
  <p>I have a simple php page for my shoutcast server to show the song played</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;?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&amp;mode=viewxml&amp;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-&gt;returnStats(); 
      $song = $returnStats['currentSong'];
       ?&gt;
  &lt;div align="center"&gt;
   &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"&gt;
   &lt;/script&gt;
  &lt;link href="votingfiles/voting.css" rel="stylesheet" type="text/css" /&gt;
  &lt;script src="votingfiles/voting.js" type="text/javascript"&gt;&lt;/script&gt;
   &lt;script&gt;
   $(document).ready(function(){
   setInterval(function(){cache_clear()},54000);
   });
   function cache_clear()
  {
   window.location.reload(true);
  }
  &lt;/script&gt;             
   &lt;div id="radio_stats"&gt;
  
   &lt;?php
    
    if( $returnStats['serverStatus'] != 0 ) {
    
   ?&gt;
    &lt;?php
    if( $returnStats['currentSong'] != "" ) {
     echo $returnStats['currentSong'];
    } else {
     echo "Undefined";
    }
    ?&gt;&lt;/div&gt;
   
    &lt;br /&gt;&lt;br /&gt;
      &lt;div class="vot_updown1" id="vt_$song"&gt;&lt;/div&gt; 
   &lt;?php
    }
    else {
   ?&gt;
   This radio server appears to be offline.
   &lt;?php
    }
   ?&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>My problem is : 
  All request Php/ajax/mysql works but actually when i make a vote, it's registered in the db like :</p>
  
  <p><strong>vt_$song  1   0</strong></p>
  
  <p>How can i do to get the real name of the song like the original php request do :</p>
  
  <p><strong>echo $returnStats['currentSong'];</strong> or <strong>echo $song;</strong></p>
  
  <p>To register in the db like : </p>
  
  <p><strong>vt_Kidd Guti-Step Everything 1 0</strong> (or any other song played)</p>
  
  <p>Example : [HERE]</p>
  
  <p>Thanks in advance for any help.</p>