I am designing an image file upload page for a website and, on Submit, the script echoes an ‘Upload Successful’ message. That all works fine.
My problem is that once the success message is on the page, it won’t go away! If the user wants to upload another file, I want him to be able to refresh the page and get rid of the echoed message. I can’t understand why that doesn’t happen by default but can anyone explain how I make that happen?
Mike
2 ways I can think of doing what you want.
First, put a link back to the upload script underneath your upload successful text.
The second way involves sending a refresh header which will redirect to the upload page after a few seconds.
This will redirect to the upload page after 3 seconds. header() must be called before your script outputs (echo) anything to the page.