Morthian Posted October 5, 2007 Share Posted October 5, 2007 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? Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.