<body><head>
<title>Browse video - Melero video</title>
<html><body>
<?php
include('config.php');
$my=str_replace("%20"," ",$_SERVER["REQUEST_URI"]);
$strcut=strstr($my, '=');
$ok=str_replace("=","",$strcut);

/////////mySQL Connect////////////////
mysql_connect($dbloc, $dbuser, $dbpass);
mysql_select_db($db); 
$result = mysql_query("SELECT * FROM categories WHERE ctn = '$ok'"); 
if (!$result) {     
echo 'Could not run query: ' . mysql_error();     
exit; } 
$rowz = mysql_fetch_row($result); 
$views=$rowz['7']+1;

$title = ucwords($rowz['1']); 
include("headertop.php");
echo '<table border=0 cellpadding=0 cellspacing=0 valign=top width=100% align=center bgcolor=white>
<td width=100% bgcolor=white valign=top>
<img src="bg.jpg" width=100% height=200>
</td>
<tr><td><P><font size=6><b>'. $title. '<P></td></table>
';
//Show all Songs Listed under selected Genre
mysql_select_db($db); 
$result = mysql_query("SELECT * FROM $ok order by id desc limit 0, 20"); 
// keeps getting the next row until there are no more to get
while($row = @mysql_fetch_array( $result )) {
$sname = substr($row['vname'], 0, 50);
if($row['image']==''){
$row['image']='nophoto.png';
}
echo '<P><table border=0 cellpadding=0 cellspacing=3 valign=top bgcolor=white align=center width=94%>
<tr><td width=20% align=center><a href=stream.php?='. $row['nextid']. '><img src="thumbs/'. $row['image']. '" width=200 height=160><font size=12><br>'.  '</a></td>
<td width=80%><font size=6>'. $row['vname']. '<br>'. $row['userid']. '<br>'. $row['date']. '<br>'. $row['views']. '</td>
</table>'; 
}
include("headerbottom.php"); 
?>


