I have a webpage that allows users to view the log files on the SD card that's on my Beaglebone. On this webpage, is a table with hyperlinks to the log files so that when the user wants to view them, they click on the specific log file and it downloads to their local system. Now, I want to put checkboxes next to these items in my HTML table so that the user can delete them off the beaglebone server when they want to.
The code was working perfectly before I tried to put the table into a form for the checkboxes. It showed up like this:
But after adding the form, nothing shows up.
The file unlink.php
refers to the code that deletes the files.
Here's the code:
<?php
$url = $_SERVER['DOCUMENT_ROOT'];
$path = "/var/www/html/Logs";
$dh = opendir($path);
$k=0;
$foo=True;
while (($file = readdir($dh)) !== false) {
if($file != "." && $file != "..") {
#echo "<a href='Logs/$file'>$file</a>";
if($k==0 || $k %7==0){
$col .= "<tr><td><input type="checkbox" name="file[]" value="Logs/$file"><a href='Logs/$file'>$file</a><br /></td>";
}
else if($k %7==6){
$col .= "<td><input type="checkbox" name="file[]" value="Logs/$file"><a href='Logs/$file'>$file</a><br /></td></tr>";
}
else{
$col .= "<td><input type="checkbox" name="file[]" value="Logs/$file"><a href='Logs/$file'>$file</a><br /></td>";
}
$k++;
}
}
echo "<form action="unlink.php" method="get"><table>$col</table><input type="submit" name="formSubmit" value="Submit" /></form> ";
closedir($dh);
?>