rendered paste body<?php$user = "*";$pass = "*";$connect = mysql_connect('localhost',$user,$pass) or die('Could not Connect:' . mysql_error());$db = 'dvddb';mysql_select_db("dvddb");if (isset($_GET["cat"])) { $catnum = $_GET["cat"]; if ($_GET["cat"] == 1) $catname = 'action'; elseif ($_GET["cat"] == 2) $catname = 'adventure'; elseif ($_GET["cat"] == 3) $catname = 'comedy'; elseif ($_GET["cat"] == 4) $catname = 'crime'; elseif ($_GET["cat"] == 5) $catname = 'horror'; elseif ($_GET["cat"] == 6) $catname = 'music'; elseif ($_GET["cat"] == 7) $catname = 'scifi'; elseif ($_GET["cat"] == 8) $catname = 'kids'; elseif ($_GET["cat"] == 9) $catname = 'television'; elseif ($_GET["cat"] == 10) $catname = 'fighting'; elseif ($_GET["cat"] == 11) $catname = 'other';} else { $catnum = 1; $catname = 'action';}if (isset($_GET["page"])) { $page = $_GET["page"];} else { $page = 1;}$perpage = 15;echo("$catname");$query = "SELECT * FROM ".$catname."";echo("$query");$cat = mysql_query($query)$total = 0;//while ($ex = mysql_fetch_array($cat)) { // $total++;//}while($row=mysql_fetch_array($cat)){echo("<strong>$row[type]</strong> <br>");}function nav() { echo "<p align='center' style='color: #FFFFFF;'><< "; if ($page > 1) { $prevpage = $page - 1; $nextpage = $page + 1; echo "<b><a href='index.php?cat=$catnum&page=$prevpage'>Previous</a></b> | "; if ($end < $total) { echo "<b><a href='index.php?cat=$catnum&page=$nextpage'>Next</a></b> >><br>"; } else { echo "<b>Next</b> >><br>"; } } else { echo "<b>Previous</b> | "; echo "<b><a href='index.php?cat=$catnum&page=2'>Next</a></b> >><br>"; } echo "</p>";}?><html><head><link rel="Shortcut Icon" href="images/favicon.ico"><title>DVD Database</title></head><body bgcolor="#365b3a" link="#ffffff" vlink="#365b3a"><table align=center bgcolor="#000000" width=900> <tr><td align=center><img src=images/header2.jpg></td></tr> <tr><td> <hr> <table align=center width=590 border=0 cellspacing=0> <tr><td><font color="#ffffff"> Browse by Category:</font> <table align=center width=590 border=7> <tr><td> <table align=center width=590 border=0> </td></tr> <tr> <td align=center width=25%><a href="index.php?cat=1"><b>Action</b></a></td> <td align=center width=25%><a href="index.php?cat=2"><b>Adventure</b></a></td> <td align=center width=25%><a href="index.php?cat=3"><b>Comedy</b></a></td> <td align=center width=25%><a href="index.php?cat=4"><b>Crime</b></a></td> </tr> <tr> <td align=center width=25%><a href="index.php?cat=5"><b>Horror</b></a></td> <td align=center width=25%><a href="index.php?cat=6"><b>Music</b></a></td> <td align=center width=25%><a href="index.php?cat=7"><b>Sci-Fi</b></a></td> <td align=center width=25%><a href="index.php?cat=8"><b>Kids</b></a></td> </tr> <tr> <td align=center width=25%><a href="index.php?cat=9"><b>Television</b></a></td> <td align=center width=25%><a href="index.php?cat=10"><b>Fighting</b></a></td> <td align=center width=25%><a href="index.php?cat=11"><b>Other</b></a></td> </td></tr> </table> </table> <table align=center width=590 border=0> <br> <tr><td align=center> <form id="form1" name="form1" method="GET" action="index.php"> <input name="q" type="text" size="50" /> <select name="cat"> <option value="1" selected="selected">All</option> <option value="2">Action</option> <option value="3">Adventure</option> <option value="4">Comedy</option> <option value="5">Crime</option> <option value="6">Horror</option> <option value="7">Music</option> <option value="8">Sci-Fi</option> <option value="9">Kids</option> <option value="10">Television</option> <option value="11">Fighting</option> <option value="12">Other</option>> </select> <input name="submit" type="submit" value="Search"> </form> </td></tr> </table> </td></tr> </table><?phpif ($page > 1) { $start = ($perpage * $page) - 1; $end = $start + $perpage;} else { $start = 0; $end = $perpage - 1;}/*nav();echo "<table align='center' width='90%' border='1' bgcolor='#365b3a'>\n";echo "\t<tr><td width='8%' align='center'>Type</td>\n";echo "\t\t<td width='86%' align='left'> Title</td>\n";echo "\t\t<td width='5%'>Discs</td>\n";echo "\t</td></tr>\n";echo "<table align='center' width='90%' border='1' bgcolor='#000000'>\n";while ($row = mysql_fetch_array($cat)) { if ($i >= $start && $i <= $end) { echo "\t<tr>\n"; echo "\t\t<td width=8% align=center><img src='images/$catnum.gif'></td>\n"; echo "\t\t<td width=87% align=left style='padding: 6px;'><a href='$row[link]' target='_blank'>$row[title]</a></td>\n"; echo "\t\t<td width=5% align=center><font color='#FFFFFF'>$row[discs]</font></td>\n"; } elseif ($i > $end) { break; } $i++;}echo "</table>\n";nav();*/?> </td></tr> <tr><td><br></td></tr> </table></table></body></html>