Michdd Posted October 23, 2008 Share Posted October 23, 2008 Because the processing file and the file with the Form are in the same file, after a user uploads a file, if he refreshes it reuploads the file, how can I stop this without seperating the form file and the processing file? Quote Link to comment Share on other sites More sharing options...
hellonoko Posted October 23, 2008 Share Posted October 23, 2008 You could put in a line at the top that checks to see if the file exists on the server. Then if it does exist don't run the rest of the script. But that might prevent over writing of the file which you might not like. Also add in lines after the upload part of the script that clean out the variables holding the upload info. And then a check at the beginning perhaps. Quote Link to comment Share on other sites More sharing options...
Michdd Posted October 23, 2008 Author Share Posted October 23, 2008 You could put in a line at the top that checks to see if the file exists on the server. Then if it does exist don't run the rest of the script. But that might prevent over writing of the file which you might not like. Also add in lines after the upload part of the script that clean out the variables holding the upload info. And then a check at the beginning perhaps. I already got the check, but how do I clear the variables? Quote Link to comment Share on other sites More sharing options...
prexep Posted October 23, 2008 Share Posted October 23, 2008 unset($variable); Quote Link to comment Share on other sites More sharing options...
samona Posted October 23, 2008 Share Posted October 23, 2008 What i do is I have a receipt page. You can create some kind of receipt page and have your script redirect to it once it is finished executing. Quote Link to comment Share on other sites More sharing options...
Michdd Posted October 23, 2008 Author Share Posted October 23, 2008 What i do is I have a receipt page. You can create some kind of receipt page and have your script redirect to it once it is finished executing. If I redirect to the same page, the variables will be gone, right? Quote Link to comment Share on other sites More sharing options...
prexep Posted October 23, 2008 Share Posted October 23, 2008 Yea, once you go to a new page or refresh the data is lost. It's like RAM once the computer is off all the data is gone. Once the page is gone (exit, refreshed, ect..) all the variables are gone. Quote Link to comment Share on other sites More sharing options...
samona Posted October 23, 2008 Share Posted October 23, 2008 If you use sessions then the variables will still hold their values. Quote Link to comment Share on other sites More sharing options...
prexep Posted October 23, 2008 Share Posted October 23, 2008 If you use sessions then the variables will still hold their values. Sessions will hold there value till the page is closed. But the variable will not hold its value. But a variable can be declared to hold the sessions value. So the variable isn't actually holding the data but the session itself. So the variable will be gone when gone to a different page but the session will still exist. Till browser is closed. Quote Link to comment 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.