Basically I have a website that lists out the files in the directory above it, and I'm trying to make some kind of "x" link next to it and, upon clicked, it will delete said file from the server.
foreach($logs as $log)
{
$noext = str_replace(".html", "", $log);
$rawlog = str_replace("../", "", $noext);
echo "<li><a href='#' onClick='javascript:loadLog(" . $rawlog . ");LogLoop();'>".$rawlog."</a></li>";
}
I'm not sure how to approach it, could I perhaps use an onclick for the X which somehow calls a PHP function to delete said file?
Any help is greatly appreciated!