mgmoses Posted June 24, 2010 Share Posted June 24, 2010 Hello everyone! I'm back again needing some help In my php script I refresh the client's screen for 5 seconds and then send them to a "thank you" page. During the refresh, I echo "Please wait. Your order is processing." My question is can I also have php display some kind of progress bar, or hourglass, at the same time it is echoing "please wait?" This would be for the 5 seconds. How would I do this? Below is the script. Thanks in advance for your help. header("refresh:5;url=http://127.0.0.1/home/ThankYou.php"); echo "Please wait. Your order is processing"; Quote Link to comment https://forums.phpfreaks.com/topic/205761-show-progress-bar-or-hourglass/ Share on other sites More sharing options...
Adam Posted June 24, 2010 Share Posted June 24, 2010 Well yeah. You just need to display an image.. ajaxload.info is good. Quote Link to comment https://forums.phpfreaks.com/topic/205761-show-progress-bar-or-hourglass/#findComment-1076728 Share on other sites More sharing options...
mgmoses Posted June 24, 2010 Author Share Posted June 24, 2010 Okay, I got the image that I want to use....Now what script do I use for php to display it for the same 5 seconds that I am echoing "please wait?" Quote Link to comment https://forums.phpfreaks.com/topic/205761-show-progress-bar-or-hourglass/#findComment-1076740 Share on other sites More sharing options...
Adam Posted June 24, 2010 Share Posted June 24, 2010 I'm not sure we're thinking the same here..? You only need to echo the img tag like you would any other HTML. You don't need to actually use PHP though, you could just: header("refresh:5;url=http://127.0.0.1/home/ThankYou.php"); ?> Please wait. Your order is processing<br /> <img src="path/to/image.gif" alt="" /> <?php // re-open it if there's more php Quote Link to comment https://forums.phpfreaks.com/topic/205761-show-progress-bar-or-hourglass/#findComment-1076744 Share on other sites More sharing options...
mgmoses Posted June 24, 2010 Author Share Posted June 24, 2010 I'm sorry, I guess I did not supply enough details. My client fills out an html form which then posts to my php file. I assumed that the code would need to be with php since once the client hits "submit," php refreshes his browser for 5 seconds and directs his browser to the html "thank you" page. If I understand how this all works, I would need to call the image in the html upon submit (but I'm already validating data upon submit), or I thought php should call the image since it's already echoing "please wait." So.....can I use the code you supplied in my php file and does it call the image for 5 seconds? There is more php after that. Thanks again. Bear with me. I'm new to all this. Quote Link to comment https://forums.phpfreaks.com/topic/205761-show-progress-bar-or-hourglass/#findComment-1076756 Share on other sites More sharing options...
mgmoses Posted June 24, 2010 Author Share Posted June 24, 2010 :DOkay, I've figured it out and I have it working perfectly. I call the image at the very beginning of my script and echo the "wait" a few lines after. When the client hits "submit" the image and the "wait" message appear together at the same time on the screen. Here are the first lines which accomplished this. <?php echo '<img src="http://127.0.0.1/Test/ajax-loader.gif" alt="">'; //Define the input variables $Name = $_POST['Name']; $Ad1 = $_POST['Ad1']; $Ad2 = $_POST['Ad2']; $City = $_POST['City']; $State = $_POST['State']; $Zip5 = $_POST['Zip5']; $Zip4 = $_POST['Zip4']; $Email = $_POST['Email']; $AreaCode = $_POST['AreaCode']; $Phone3 = $_POST['Phone3']; $Phone4 = $_POST['Phone4']; $Ext = $_POST['Ext']; header("refresh:5;url=http://127.0.0.1/home/ThankYou.php"); echo "Please wait. Your order is processing"; Maybe this will help someone else. Quote Link to comment https://forums.phpfreaks.com/topic/205761-show-progress-bar-or-hourglass/#findComment-1076824 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.