<?
require('./api.php');
require('./config.php');
if(isset($_POST['sendrequest'])){
$fid = $_POST['track'];
connectdb();
mysql_query("INSERT INTO requests(fid,sid) VALUES('".$fid."','".$sid."')");
echo "Your Request has been submitted!";
}


?>
<table border="0" width="100%">
<?
connectdb();
$pid = getserverpls();
$query = mysql_query("SELECT media.artist,media.song,media.album,media.year,media.id FROM media,playlist_content,playlist WHERE playlist_content.pid='".$pid."' AND playlist_content.fid=media.id AND playlist_content.pid=playlist.id ORDER BY media.artist");
while($row = mysql_fetch_row($query)){
echo "<tr><td>".$row[0]."</td><td>".$row[2]."</td><td>".$row[1]."</td><td><form action=\"\" method=\"post\" enctype=\"multipart/form-data\"><input type=\"hidden\" value=\"".$row[4]."\" name=\"track\"><input type=\"submit\" value=\"Request\" name=\"sendrequest\"></form></tr>";
}
?>
</table>

