I'm using a small site to experiment with the uploading of pictures and displaying them.
When someone clicks "add a picture", they get taken to a page with a form on it. They can select a file and click the submit button.
But what I want to do now is this: put a second submit button labeled "Cancel" next to the normal confirmation button. If someone then chooses to upload, selects and hits submit, if they press the cancel button before the file is fully uploaded, PHP should stop the uploading of the file and delete it. And then just go back to the overview.
No Javascript used whatsoever.
I only have localhost, so testing this in kindof impossible, since I just copy a file the millisecond I press the submit button. There's no upload-time with a localhost and I'm not going to buy a server somewhere just for this.
Basically what's happening now is that the PHP detects which button was sent. If the submit button was sent, the file is uploaded, if the cancel button is sent, it just goes back to the overview.
But PHP does its tasks one in a row. So I don't think this will work. How do I tell PHP to stop doing the upload?