Forum Moderators: coopster
<?php
$dir = 'classifieds/'."$_GET[subcategory]";
$fp = @opendir($dir);
while ($file = @readdir($fp)) {
if (preg_match("/^[a-zA-Z0-9\/\-\_]+\.htm$/", $file)) {
require_once($dir.'/'.$file);
echo "<br />";
} elseif (preg_match("/^[a-zA-Z0-9\/\-\_]+\.jpg$/", $image)) {
echo "<img src='".$dir."/".$image."'"." alt='advertisement' />";
}
}
@closedir($fp);
?>
any help would be greatly appreciated!