Listing files on the hard drive
Posted: Fri Dec 27, 2002 8:23 pm
I'm trying to code a PHP page so I can view the images in folders on my hard drive. It's a simple idea that the $folder value is specified in the URL, and it works fine for files online but I don't know how to set the root to look in the C: drive. Any help?
Code: Select all
<?php
$root = ("image_folder");
if ($value = opendir("$root/$folder")) {
while (false !== ($file = readdir($value))) {
print ("<img src="$root/$folder/$file"><br>");
}
}
?>