Jump to content
Larry Ullman's Book Forums

How To Prevent Uploading Duplicate Pdfs By Refresh?

Recommended Posts

It may not be the best way but one way is forwarding yourself to the same page with a success tag if the file uploaded successfully. Like...


header ("Location: {$_SERVER['PHP_SELF']}?success=y");


and in the code have something along the lines of


if (isset ($_GET['success']) && ($_GET['success'] == "y")) {

echo '<h4>The file has been uploaded!</h4>';


That way if you click refresh it will just reload the page rather than uploading the file again.

  • Upvote 1
Link to comment
Share on other sites


  • Create New...