Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

a "wait" screen

Status
Not open for further replies.

stasJohn

Programmer
Joined
May 6, 2004
Messages
155
Location
US
I'd like to know if the following is possible to do in php. Preferably only php, not something like a php+javascript solution.

The site contains a database with 4 tables. The user will export their data from an access database, and then upload the 4 csv files to the server in order to update the database.

What I'd like to have is a "wait" page which displays a message like "Uploading files" with an animated graphic or something while the files are being uploaded and the database updated. Much like searching for a flight or hotel on expedia.com or travelocity.com

How can this be done with php?




Additionally I was wondering if a series of messages could be printed out as the script runs, for example:

script starts... print "update started\n"
file1 uploaded... print "file1 uploaded... "
table1 updated... print "table1 updated successfully\n"

...and son on.



Thanks for the help!
 
sure...

when the submit button is hit to start the process, then echo the animated graphic, and below that start echoing the

echo "update started\n"
echo "file1 uploaded... "
echo "table1 updated successfully\n"

at the appropriate points in the program. I use a similar approach when uploading large tables and updating the records.

echo "examining record for blah:";
echo "updating record for blah";
echo "All updates complete";


Bastien

Cat, the other other white meat
 
I know you could do this with CGI by playing around with buffers and such like, I would have thought some well placed flush() calls would be needed.
Bastein do you have to configure the browser in any way ?
 
Thanks for the reply,
I just want to make sure I got this right.

setup
page1.php <- contains a form which points to script.php
script.php <- the code to process the tables (including echo
statements)

The user hits submit, the script is called, the screen is cleared. (Does the screen clear, or are all the echos printed at the bottom of the page?)
As the script runs, whenever it encounters an echo, its printed to the browser window.
 
I must admit I thought you would have to wait until the PHP finished and flushed the output. I might give it a try.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top