Gamerz Posted October 18, 2009 Share Posted October 18, 2009 What is the best way to expire a page after it's loaded for one time.. Here is my problem: I have a file uploader...someone uses my uploader, and uploads something. They refresh it, and the image gets uploaded again. Quote Link to comment https://forums.phpfreaks.com/topic/178092-php-expire-page-after-its-loaded-instantly/ Share on other sites More sharing options...
mikesta707 Posted October 18, 2009 Share Posted October 18, 2009 if you want a simple form of flood protection, you could create a session, like so //after you do all the form stuff $_SESSION['formXYZ_sent'] = true; then simply check if they sent the form already if (isset($_SESSION['formXYZ_sent']) && $_SESSION['formXYZ_sent']){ //form stuff } else { echo "Information already recieved"; } Quote Link to comment https://forums.phpfreaks.com/topic/178092-php-expire-page-after-its-loaded-instantly/#findComment-939042 Share on other sites More sharing options...
Gamerz Posted October 18, 2009 Author Share Posted October 18, 2009 Wait, I dont get it... So do you put $_SESSION['formXYZ_sent'] = true; on the upload processing page or literally right after the form. And do you put the below code before the actual form? I'm a lil confused if (isset($_SESSION['formXYZ_sent']) && $_SESSION['formXYZ_sent']){ //form stuff } else { echo "Information already recieved"; } Quote Link to comment https://forums.phpfreaks.com/topic/178092-php-expire-page-after-its-loaded-instantly/#findComment-939046 Share on other sites More sharing options...
Kaboom Posted October 18, 2009 Share Posted October 18, 2009 after upload send them someplace new so cant refresh and add die; so cant use resubmit? Quote Link to comment https://forums.phpfreaks.com/topic/178092-php-expire-page-after-its-loaded-instantly/#findComment-939070 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.