Instead of posting on my previous post Im going to make another one on another question I have.
When I run this scrip tit works great BUT it shows (current directory) "." and one level above directory ". ." how do I not show these when running this script?
<html>
<head>
<title>Browse</title>
</head>
<body>
<h1>Browsing</h1>
<?
$current_url = "http://www.domain.com/pics/thumb/";
$current_dir = "/home/account/public_html/pics/thumb/";
$dir = opendir($current_dir);
$i = 0;
while ($file = readdir($dir))
{
$i++;
$newFile = preg_replace("/tn_/i",'',$file);
echo "<a href=http://www.domain.com/pics/$newFile><img src=$current_url$file /></a>";
echo "<br>$file<br>";
}
echo "TOTAL FILES: $i";
echo "<hr><br>";
closedir($dir);
?>
</body>
</html>
Should I do something like this?
if (is_dir($file) == "true") {
#do nothing leave blank
}else{
#continue code
}
Or would there be a better way of doing this