please I am not able to read the setup files from a folder using php and...

alexandre r

New member
...display on a page? I am designing a website using apache(xamp).. I have a page where people are supposed to dowloan software setups. I have been able to upload the files to a folder called Softwares in the htdocs..I am not able to read the setup files from a folder using php and display on a page. here is the code.please what is wrong with this code. how else could i do it
<?php
echo "<tr><td>$file</td></tr><tr><td><a href=\"$file\" target=\"_blank\"><img src=\"$file\" border=\"0\"> </a></td></tr>";
//$path="/Softloads/Softwares/";
if ($handle = opendir('/Softwares/')) {
echo "<table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
while (false !== ($file = readdir($handle)))
{
if (!is_dir($file))
{
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