good solution lorna..
Main Topics
Browse All TopicsHi,
I am executing the below UNIX command through PHP:
passthru("\/opt\/ansys-v7.
The command submits an input file to a software and the software writes the output to the output file.
It requires some time for the output file to be created.
IN That time i wish to show on the page messages like " Wait the job is in Process " and then show the contents of the outputfile when it is created.
Can i do it with redirection using header? Or how can i do it.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
LornaJane gives you an excelent solution, another header you could use is :
header( 'refresh: 15; url=readoutput.php' );
echo '<h1>You will be re-directed in 15 seconds...</h1>';
call_the_process
This is a header that will refresh the actual page to the readoutput.php page after a fixed number of seconds. Make sure to put sufficient seconds for the process to terminate.
The solution by Lorna is efficient and ellegant too. : )
Maratmu, just combine the two answers... or make the redirection by javascript, this way:
Print a "please wait" message
Call the function
Use this javascript:
<SCRIPT LANGUAGE="JavaScript">wind
As Lorna said.... The redirect won't happen until that function has returned and in the meantime the use will see your wait message.
In adition, if you aren't sure all your users will have javascript enabled, you can put at the very start of the script a php header( 'refresh: 60; url=readoutput.php' );
This way, if javascript doesn't work in the client's part, at least a refresh will be done after 60 (or whatever you want) seconds. I hope it may help : ) Sorry for the bad english.
Business Accounts
Answer for Membership
by: LornaJanePosted on 2003-10-10 at 02:07:23ID: 9526300
I think the way to do this would be to call the function as you have done, but exclude the & from the end of it - this & makes the command runs in the background so it won't notify you when it returns. Print a "please wait" message, then call the function, then do a header redirect. The redirect won't happen until that function has returned and in the meantime the use will see your wait message.
Try it, and let me know how you get on!