Jump to content

Problem with POST data


Morthian

Recommended Posts

I have a script that will upload a file and store its information in a database based on POST data. The script will set a variable to either a success message or an error message, depending on whether the upload was successful or not. The message variable will then be outputted to the user.

 

The problem here is that if a user successfully uploads a file and then clicks back or refresh in the browser, the "You are trying to view a page that contains POSTDATA" dialog will appear. If the user simply clicks OK on this dialog, the file will be re-uploaded and a duplicate of the submission's record will be created.

 

The only way I know to avoid this dialog is by using the header() function to clear the POST data. However, if I use this function, not only will the POST data be cleared, but the variable containing the success message will also be cleared, and there will be no confirmation to the user that their submission was uploaded successfully.

 

How can I solve this problem?

Link to comment
https://forums.phpfreaks.com/topic/71910-problem-with-post-data/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.