MoMoMajor Posted July 24, 2009 Share Posted July 24, 2009 Ok so i have a simple image upload script and I am unable to make the stop executing after the first upload. After the initial upload loads successfully it continues to load the same image whenever the user refreshes the page. i have tried unset($_FILES['userfile']) and also making the script die but neither work. Link to comment https://forums.phpfreaks.com/topic/167236-problem-ending-upload-script/ Share on other sites More sharing options...
MoMoMajor Posted July 24, 2009 Author Share Posted July 24, 2009 i have tried: unset($_FILES) and unset($_FILES['userfile']) empty($_FILES) and unset($_FILES['userfile']) and unlink($_FILES) and unset($_FILES['userfile']) but the form continues to upload the same image whenever i refresh the page. Link to comment https://forums.phpfreaks.com/topic/167236-problem-ending-upload-script/#findComment-881780 Share on other sites More sharing options...
Bricktop Posted July 24, 2009 Share Posted July 24, 2009 Are you able to post your code so we can take a proper look MoMoMajor? Either that or if you have any field validation in place, unset those variables and the form will not be able to be re-posted. Link to comment https://forums.phpfreaks.com/topic/167236-problem-ending-upload-script/#findComment-881909 Share on other sites More sharing options...
haku Posted July 24, 2009 Share Posted July 24, 2009 If you don't want the file to re-upload when the user hits refresh, you will have to redirect them to another page and back. You can do this in the background on the server in a few ways. You can have the php processing done in it's own file, redirecting the user to the landing page after the processing, or you can do the processing on the same page, and after it has finished processing, it redirects the user to another page and then right back to that page (they won't see this happen - it's in the background on the server). Link to comment https://forums.phpfreaks.com/topic/167236-problem-ending-upload-script/#findComment-881912 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.