Loading screen after submit button is clicked, before going to the next page

I have looked all over the Internet but cannot find the code to do this. The user uploads an image then clicks on a Submit button which brings them to add.php. After they click the Submit button, I want a loading screen to take up the whole page with an animted gif and a message saying “your image is uploading” for about 5 seconds. Then, I want it to go ahead to add.php. Here is the code for the button:

[php]
echo “<form enctype=“multipart/form-data” action=“add.php” method=“POST”>”;
echo "Please upload a photo and then click Submit:

“;
echo " <input type=“file” name=“photo”>

”;
echo " <input type=“submit” value=“Submit” “>”;
echo " ";
[/php]

Does anyone have the code to do this?

That’s typically an ajax or jquery thing. don’t know how to due it though.

While this can be done with php, it is messy and I wouldn’t recommend it. Let me know if you would like me to detail the process.

I am not very strong in javascript, but see if the following is what you are looking for…[code]

Upload Image #theImage{ display: none; margin: auto; width: 100%; } #message{ font-size: 200%; text-align: center; width: 100%; } #myImage{ width: 100%; margin: auto; } #myForm{ display: inline; }
Please upload a photo and then click Submit:



Your Image is Uploading...
My Image
[/code]

Make sure to insert the correct path to your image.

Let me know…

Sponsor our Newsletter | Privacy Policy | Terms of Service