I want to display files from a folder on the local server I am using php and...

DzSoundNirvana

New member
all you do s drop in the folder you want and change "echo "<tr><td>$file</td></tr><tr><td><a href=\"$file\" target=\"_blank\"><img src=\"$file\" border=\"0\"> </a></td></tr>";" to what ever you want


<?
if ($handle = opendir('.')) {
echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "<tr><td>$file</td></tr><tr><td><a href=\"$file\" target=\"_blank\"><img src=\"$file\" border=\"0\"> </a></td></tr>";
}
}
echo "</table>";
closedir($handle);
}
?>
 
...dreamweaver 8? please I want to automatically load the file which are in a folder on the local sever and display them on a page where people could dowload them. I have tryied many ways but it does not work.please how do I do it. the file could be executable file. I am using xamp, with apache and mysql. please all alternatives to do it are welcome
 
all you do s drop in the folder you want and change "echo "<tr><td>$file</td></tr><tr><td><a href=\"$file\" target=\"_blank\"><img src=\"$file\" border=\"0\"> </a></td></tr>";" to what ever you want


<?
if ($handle = opendir('.')) {
echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "<tr><td>$file</td></tr><tr><td><a href=\"$file\" target=\"_blank\"><img src=\"$file\" border=\"0\"> </a></td></tr>";
}
}
echo "</table>";
closedir($handle);
}
?>
 
Back
Top