boos Posted September 19, 2011 Share Posted September 19, 2011 When i clicked the refresh button on the add pdf page it uploads the the pdf file again. How would i prevent this? Link to comment Share on other sites More sharing options...
Craig-UK Posted September 19, 2011 Share Posted September 19, 2011 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"); exit(); 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. 1 Link to comment Share on other sites More sharing options...
boos Posted September 22, 2011 Author Share Posted September 22, 2011 Makes prefect sense, thanks. Link to comment Share on other sites More sharing options...
Craig-UK Posted September 22, 2011 Share Posted September 22, 2011 No problem Link to comment Share on other sites More sharing options...
Larry Posted September 23, 2011 Share Posted September 23, 2011 Thanks, Craig! I like the signature, by the way. How self-serving would it be of me to encourage everyone to identify how many books of mine they own? Link to comment Share on other sites More sharing options...
Recommended Posts