tinklerb
asked on
PHP, AJAX, "Please wait", and a redirect
Folks,
I have page1.php that loads and displays an animated gif image to entertain people while the order they have placed is being processed.
I know there has to be a way to get AJAX to fire off the execution of the processorder.php file that does all of the complex order processing and posts the user order.
The last thing I need to accomplish, is to make the page1.php page redirect to the next php opage when the ajax request is complet. So here's my questions:
1) If there are no form elements on this page, can I call the processorder.php using AJAX in the <body> tag with an onload event?
2) Once it returns the results, I want he page to be immediately redirected to aother page. How can I do this, assuming that I can use the return from the AJAX call to indicate when it is complete.
3) Is it possible to remove the wait page (page1.php) from the browser's history so that the user does not hit the 'Back' button and start the process over inadvertently
I have seen a great example in asp.net at http://www.codeproject.com/KB/aspnet/wait_page.aspx but can't figure out how to recreate this in javascript and AJAX calls via PHP scripts.
Let me know if anyone needs more details. I've been reading web sites on how to get this done for 2 days, and a lot of them come close, but the redirect is the stumper...
Thanks!
I have page1.php that loads and displays an animated gif image to entertain people while the order they have placed is being processed.
I know there has to be a way to get AJAX to fire off the execution of the processorder.php file that does all of the complex order processing and posts the user order.
The last thing I need to accomplish, is to make the page1.php page redirect to the next php opage when the ajax request is complet. So here's my questions:
1) If there are no form elements on this page, can I call the processorder.php using AJAX in the <body> tag with an onload event?
2) Once it returns the results, I want he page to be immediately redirected to aother page. How can I do this, assuming that I can use the return from the AJAX call to indicate when it is complete.
3) Is it possible to remove the wait page (page1.php) from the browser's history so that the user does not hit the 'Back' button and start the process over inadvertently
I have seen a great example in asp.net at http://www.codeproject.com/KB/aspnet/wait_page.aspx but can't figure out how to recreate this in javascript and AJAX calls via PHP scripts.
Let me know if anyone needs more details. I've been reading web sites on how to get this done for 2 days, and a lot of them come close, but the redirect is the stumper...
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Folks,
Thanks for the suggestions. I have some time set aside this afternoon to try to put them into place, and will reply later today or forst thing tomorrow with the results. In the mean time, thanks for the help!
Brian
Thanks for the suggestions. I have some time set aside this afternoon to try to put them into place, and will reply later today or forst thing tomorrow with the results. In the mean time, thanks for the help!
Brian
ASKER
Folks,
I have successfully got points one and two to work based on the recommendations. Now on to the third point I had above.
3) Is it possible to remove the wait page (page1.php) from the browser's history so that the user does not hit the 'Back' button and start the process over inadvertently
Once this is solved, this screen can go into production. Any ideas?
I have successfully got points one and two to work based on the recommendations. Now on to the third point I had above.
3) Is it possible to remove the wait page (page1.php) from the browser's history so that the user does not hit the 'Back' button and start the process over inadvertently
Once this is solved, this screen can go into production. Any ideas?
Open in new window