So I am creating a small file manager with php that will list in a table all available files in a directory on my server and provide me with a downloads or delete option.
This is my code:
<html>
<head>
<title>My first PHP Page</title>
</head>
<body>
<iframe id="my_iframe" style="display:none;"></iframe>
<table border="1">
<?php
$dir = 'uploads';
$files = scandir($dir);
sort($files);
$count = -1 ;
foreach ($files as $file) {
if ($file != '.' && $file != '..') {
$str_URL = "uploads".$file;
echo "<tr>";
echo "<td>";
echo $count;
echo "</td>";
echo "<td>";
echo $file;
echo "</td>";
echo "<td>";
echo "<input type='submit' value='Download'/>";
echo "</td>";
echo "<td>";
echo "<input type='submit' value='Delete'/>";
echo "</td>";
echo "<td>";
echo "<input type='submit' value='Rename'/>";
echo "</td>";
echo "</tr>";
}
$count++;
}
?>
</table>
</body>
</html>
I am able to list files but I can't get the "download" and "delete" buttons to work properly.
Any help is greatly appreciated and thank you very much in advance.