Hiya

Im new to php and am trying to display filenames within directorys and be able to drill down into lower directories within an html page.

I have this file displaydir.php

$dir_to_be_read = "C:/Program Files/ApacheGroup/Apache2/cgi-bin/";
$current_dir = "$dir_to_be_read";

$dir = opendir($current_dir);

echo "Upload directory is $current_dir<br>";
echo "Directory Listing:<br><hr><br>";

while ($file = readdir($dir))
{
echo "<a href=\"openfile.php?file=".$file."\">".$file."</a><br>";
}
closedir($dir);

I also have this file openfile.php

$current_dir = "$dir_to_be_read";
$file = basename($file);
//if (is_dir($file))

echo "<h1>Details of file: ".$file."</h1>";

The actual question is where to put the is_dir test...it makes sense to be in the openfile.php?
also how can I do this logic:

if file print details of file //already got in openfile.php
if directory -call again displaydir.php but this time with the new
$dir_to_read? so it shows the file in the new drill down directory.

Cheers
Bobby




_________________________________________________________________
Stay in touch with MSN Messenger http://messenger.msn.co.uk


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to