<title>Edit Playlist - Melero Video</title>
<?php include("headertop.php"); 
$my=str_replace("%20"," ",$_SERVER["REQUEST_URI"]);
$strcut=strstr($my, '=');
$ok=str_replace("=","",$strcut);
mysql_connect($dbloc, $dbuser, $dbpass);
mysql_select_db($db); 
//Delete 
if(@$_POST['delete']){
$duser=$_POST['delete'];
$theplay=$_COOKIE['username']. $ok;
$results = mysql_query("DELETE FROM $theplay WHERE id=$duser");
echo $duser;
}
///////////////Get the Playlist info
$getplaylistinfo= $_COOKIE['username']. $ok;
$result = mysql_query("SELECT * FROM $getplaylistinfo WHERE id = '$ok'"); 
$rowz = mysql_fetch_row($result); 
$title=$rowz['1'];
$nextid=$rowz['4'];
$gettheplaylist=$_COOKIE['username']. $nextid;
echo '<P><BR><p><table width=96% bgcolor=white align=center><td width=25% align=center>
<a href=playlist.php?='. $ok. '><img src="thumbs/play.png" width=120 height=80></img></a>
</td><td valign=top><b>'. $rowz['3']. '</b><p>
By: '. $_COOKIE['username']. ' * 10 Videos * '. $nextid=$rowz['4']. ' Views<p>
<a href=playlist.php?='. $ok. '>Play</a> * <a href="playlistdelete.php?='. $ok. '">Delete</a>
</td></table><P>';
$getplist=$_COOKIE['username'].$ok;
$resultm = mysql_query("SELECT * FROM $getplist");
   $dept = array();
    while($row=mysql_fetch_array($resultm))
    {
      //echo $row['allgenreid'];
$myid=$row['allgenreid'];
$resultmn = mysql_query("SELECT * FROM allgenres where id=$myid");
   $depts = array();
    while($rowmn=mysql_fetch_array($resultmn))
    {
$number++;
///////////Get all the videos from the playlist
echo '<table width=96% bgcolor=white align=center border=0 cellpadding=0 cellspacing=0>';

echo '<tr><td width=3%><center>'. $number. '</td><td width=15%><a href="stream.php?='. $rowmn['0']. '"><img src="thumbs/'. $rowmn['9']. 
'" width=120 height=90></a></td><td width=42%>'. $rowmn['3']. '</td><td width=15%>'. 
$rowmn['userid'].'</td><td align=left width=10%>'. $rowmn['1']. '</td><td align=left>
<form action="" METHOD="post">
<input type=hidden name=delete value="'. $row['id']. ' ">
<input type=submit value="Delete">
</form>
</td></table>
<table width=96% align=center border=0 cellpadding=0 cellspacing=0 height=2><td></tD></table>';
     }
     }
?>
</table>
<?php include("headerbottom.php"); ?>
