hi, sorry to doulbe post but if anyone was wondering what the nearly finished piece of code looks like here it is :
<?php
$path = "/home/public_html/";
$dir_handle = @opendir($path) or die("Unable to open $path");
while ($file = readdir($dir_handle)) {
if($file == "." || $file == ".." || $file == "upload_delete.php" || $file == "php.ini" )
continue;
$path_parts = pathinfo("/home/public_html/$file/");
echo $path_parts['dirname'], "\n<br>";
echo $path_parts['basename'], "\n<br>";
echo $path_parts['extension'], "\n<br>";
if ( $path_parts['extension'] == "txt") { echo("<a href=\"$file\">$file</a><br>"); }
elseif ( $path_parts['extension'] == "png") { echo("<img src=\"$file\"><br>"); }
else { echo("something wrong<br>"); }
}//keeps it repeating
closedir($dir_handle);
?>
obvoiusly i would take some parts out to neaten it up on the page and add some more variables for different file types.
thanx, jamez.😃