JaeSun
03-07-2005, 11:19 AM
i have this code ...
its a upload class (getting sick of my threads lately?) ...
everything works fine, except in one case ....
it does error checking, and if there is an error, it redirects and prints out an error message, and allows the user to try again ....
in the case that i am trying, it checks to see if the file exists, and if so, error's out ... (i havent checked other situations with other errors)
but when it error's out and gives the user another chance to upload a different file, it gives the user the same error everytime, even if the file doesnt exist .... and i dont know why
if you hit the back button, and try again, it works ....
upload_media.rtf has all the functions for the uploading and checking for errors ... it includes the class (class.upload.rtf) which holds the class of functions for uploading and error checking ...
upload.rtf is just the file that calls it, and displays the output ....
in upload_media.rtf, it is called everytime upload.php is called (or upload.rtf) .....
it has 3 if statements, one for if it needs to upload the file (which is checked based on whether a session "status" variable is set or not), one for if there is an error (which is checked on the session "status" variable being set and the $_GET action=sucess NOT being set, and a last one if it is successfull in uploading (which is by the SESSION status variable being set and the $_GET action=success being set ...
(the SESSION status variable is unset at every upload) so i know it is not being skipped when the user is trying to upload the second time (it only sets the SESSION status variable when it is trying to upload the file) ...
any ideas?
here is the code:
http://www.whiteazn.com/fbc/test/class.upload.rtf
http://www.whiteazn.com/fbc/test/upload.rtf
http://www.whiteazn.com/fbc/test/upload_media.rtf
its a upload class (getting sick of my threads lately?) ...
everything works fine, except in one case ....
it does error checking, and if there is an error, it redirects and prints out an error message, and allows the user to try again ....
in the case that i am trying, it checks to see if the file exists, and if so, error's out ... (i havent checked other situations with other errors)
but when it error's out and gives the user another chance to upload a different file, it gives the user the same error everytime, even if the file doesnt exist .... and i dont know why
if you hit the back button, and try again, it works ....
upload_media.rtf has all the functions for the uploading and checking for errors ... it includes the class (class.upload.rtf) which holds the class of functions for uploading and error checking ...
upload.rtf is just the file that calls it, and displays the output ....
in upload_media.rtf, it is called everytime upload.php is called (or upload.rtf) .....
it has 3 if statements, one for if it needs to upload the file (which is checked based on whether a session "status" variable is set or not), one for if there is an error (which is checked on the session "status" variable being set and the $_GET action=sucess NOT being set, and a last one if it is successfull in uploading (which is by the SESSION status variable being set and the $_GET action=success being set ...
(the SESSION status variable is unset at every upload) so i know it is not being skipped when the user is trying to upload the second time (it only sets the SESSION status variable when it is trying to upload the file) ...
any ideas?
here is the code:
http://www.whiteazn.com/fbc/test/class.upload.rtf
http://www.whiteazn.com/fbc/test/upload.rtf
http://www.whiteazn.com/fbc/test/upload_media.rtf