Hi,
I have been given the following code to help display the contents of a folder on my website for users to view files. However it also adds the script itsel "list.php" is there any way that .php or other extensions could be hidden/removed?
I am trying to learn perl, and not PHP so you can see my problem LOL. I just needed this working on my site...
Thanks in advance..
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<title>BLAH</title>
<head> <img src="/images/uploads_list.jpg" width="300" height="80">
</head>
<body bgcolor="#000000" text="#FFFFFF" link="#FF0000" vlink="#FF0000" alink="#FF0000">
<table align="left" width="550" border="0" cellspacing="1" cellpadding="1"><tr bgcolor="#000000"><td>
<table width="550" border="0" cellspacing="1" cellpadding="1">
<tr><td bgcolor="#000000"> File Name:</td><td bgcolor="#000000"> File Size:</td><td bgcolor="#000000"> Last Modified</td></tr>
<?
$handle = opendir('.');
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != ".." && $file != ".php" && $file != ".htaccess")
{
$num=count($file);
for ($a=0; $a < $num; $a++)
{
$file_size = filesize($file);
$last_mod = date("m/d/Y G:i:s", filectime($file));
echo ("<title>Carblife Musketeers Upload List</title>");
echo ("<TR><TD bgcolor='000000'><A HREF='$file'>$file</A></TD>");
echo ("<TD bgcolor='000000'>$file_size</TD>");
echo ("<TD bgcolor='000000'>$last_mod</TD></TR>");
}
}
}
closedir($handle);
echo "</table></td></tr></table>";
?>
</body>