I currently have an upload button that saves all types of files to a MySQL table. I have an exit button that I want to delete the currently uploaded files if clicked. NOTE: all files uploaded on current page has same referenceID so the query is as easy as saying delete all from table where id=id..
Here is the button:
<button type="submit" name="submit" value="exit" style="float:left;
class="buttonLW" href="https://BACK-LINK">exit
</button>
Here is the PHP delete query (psuedo code):
if ($submitButton === "delete-new") {
$query15 ="DELETE * FROM table WHERE id='{$id}'";
}
my question, is the button allowed to use this sort of format? am I allowed to say if ($submitButton === "delete-new") without using a form?
How can I go about deleting the currently saved files with same id after clicking my exit button.