Forum Moderators: coopster
What sort of directory are you referring to?
If you're referring to a database then it would be a table rather than a directory.
If you want to access a given directory on a server that contains a file that PHP should read, check out [zend.com...] for a tutorial on how to do that.
Getting a list of files from a given website involves either going to the FTP site or finding a host that gives you the option to list all the files on the site.
You could even be talking about Windows, so provide more specifics and I'll be glad to help you out further ;)
<table>
<?php
$uploadDir = '\\sun201/phptest/Files_to_Review/';
if ($handle = opendir($uploadDir)) {
while (false!== ($file = readdir($handle))) {
if ($file!= "." && $file!= "..") {
$fullpath = $uploadDir.$file;
echo "<tr><td><b><a href='$fullpath'>$file</a></b></td>";?>
<td> <a href='#' onClick="if(confirm('Are you sure you wish to delete this file?')) {
window.open('filedelete.php?path=<?php echo $fullpath;?>','UploadFile','top=30,left=30,width=350,height=150');return
true; } else { return false; }">Delete</a>
</td>
</tr>
<?php
}
}
closedir($handle);
}
?>
</table>