Hello all, using this code below, my pages seem to stop loading after just before the while loop of reading the directory. I can't figure out why though.
Here is the code with a note as to where the browser stops reading it.
if(!$_GET['cmd']){
$handle = opendir($site_dir);
if(!is_dir($site_dir)){ echo "Error :: The path to the files (".$site_dir.") is incorrect."; include_once('footer.inc.php'); exit; }
echo "<table border='0' width='95%' cellspacing='0' cellpadding='0' align='center'>
<tr background=\"$site_dir/images/bevel_bg.gif\">
<td align='center'>Product ID</td><td align='center'>Product Title</td><td align='center'>Delete</td></tr>"; //browser stops here
while(($file = readdir($handle)) != FALSE){
if($file != "." && $file != ".."){
$product = strrrchr($file, "_");
$sql = mysql_query("SELECT title FROM ".$prefix."store_inventory WHERE product='$product'") or die(mysql_error());
$row = mysql_fetch_array($sql) or die(mysql_error());
$title = $row['title'];
echo "<tr bgcolor='$bgcolour'><td align='center'><a href='view_product.php?product=$product' target='_blank'>".$product."</a></td>";
echo "<td align='center'>".$title."</td>";
echo "<td align='center'><a href='pagecreation.php?cmd=deletesingle&ID=$product' target='_self'>Delete</a></td></tr>";
} else { break; }//end if not . or ..
}//end while
echo "</table>";
include_once('footer.inc.php');
exit;
}//end if no cmd
Any help would be great. Thanks!