Jump to content

Show progress bar or hourglass?


mgmoses

Recommended Posts

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";

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

: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. :shrug:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.