I want to be able to carry $_POST['v']
(string) to delete.php using an HTML form button.
$directory = "exports/";
$contents = scandir($directory,1);
foreach($contents as $k => $v) {
if ($v != '.' && $v != '..') {
echo "<a href=\"$directory" . $v . "\">".$v."</a>";
echo "<form action=\"delete.php\" method=\"post\"><a class=\"buttonnohover\"><input type=\"submit\" class=\"button\" name=\"v\" value=\"Delete\" /></form> <br>";
}
}
At the moment the submit button simply brings back string(6) "Delete". I want $_POST['v'] to equal each individual $v (filename within the directory) carried on each button.
What am I not doing right?