By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,050 Members | 1,283 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,050 IT Pros & Developers. It's quick & easy.

status note for scripts that run a long time

P: n/a
Hi,
I got some script, that depending on the parameters it gets can take
20min or so to finish execution. When running the script for these
20min one sees nothing but a white page, which is somewhat bad, as the
user think's something is wrong. So I wonder if there's a way to tell
the user, that the script is still running and he's got to wait.

Any suggestions?
Thanks a lot in advance.
Lars
Jul 17 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
*** lars knut wrote/escribió (25 Mar 2004 02:17:35 -0800):
So I wonder if there's a way to tell the user, that the script is still
running and he's got to wait.


In this situation, I normally use "echo"'s:

echo "Processing row #" . $row_nr;

Or maybe

if($row_nr % 100 == 0){
echo "Processing row #" . $row_nr;
}

--
--
-- Álvaro G. Vicario - Burgos, Spain --
Jul 17 '05 #2

P: n/a
Alvaro G Vicario wrote:
*** lars knut wrote/escribió (25 Mar 2004 02:17:35 -0800):
So I wonder if there's a way to tell the user, that the script is still
running and he's got to wait.

In this situation, I normally use "echo"'s:

echo "Processing row #" . $row_nr;


I've tried that but Apache caches the php output and it all appears
together at the end. Is there any way to force buffering off?
Jul 17 '05 #3

P: n/a
Kevin Thorpe wrote:
Alvaro G Vicario wrote:
*** lars knut wrote/escribió (25 Mar 2004 02:17:35 -0800):
So I wonder if there's a way to tell the user, that the script is still
running and he's got to wait.


In this situation, I normally use "echo"'s:

echo "Processing row #" . $row_nr;

I've tried that but Apache caches the php output and it all appears
together at the end. Is there any way to force buffering off?


Well, apache is doing some caching, but PHP too. To send the output
buffer of PHP, use *flush*. I'm using this in some of my scripts to send
to the browser the output produced by shell scripts while they are
running and it works fine.

--
Guillaume Brocker
Jul 17 '05 #4

P: n/a
Hi,
I tried the flush() version. However it's not quite what I want. I
thought there would be a way which would allow me to show the user
that he's got to wait by means of a text like "Please wait..." and
when showing the results get rid of that text.
When I use flush instead, some part of the website already shows and
some part does not, which leads the user to assume, that there'S been
an error.

Does anybody have an idea how to handle that?

Thanks a lot
Lars
Jul 17 '05 #5

P: n/a
lars knut wrote:
I thought there would be a way which would allow me to show the user
that he's got to wait by means of a text like "Please wait..." and
when showing the results get rid of that text. Does anybody have an idea how to handle that?


Your clients do not mind having a browser window open for 20 minutes
with the words "Please wait ..."? !!! I would!
Anyway ...

I think JavaScript may be a way to do that

<OT trolling="I don't know JavaScript">

send a <p id="pleasewait">Please wait...</p>
flush (maybe send a few spaces to fill browser cache)
process for 20 minutes
send javascript to turn "pleasewait" paragraph invisible/hidden

</OT>

--
USENET would be a better place if everybody read: : mail address :
http://www.catb.org/~esr/faqs/smart-questions.html : is valid for :
http://www.netmeister.org/news/learn2quote2.html : "text/plain" :
http://www.expita.com/nomime.html : to 10K bytes :
Jul 17 '05 #6

P: n/a
la*******@gmx.net (lars knut) wrote in message news:<dd**************************@posting.google. com>...
Hi,
I tried the flush() version. However it's not quite what I want. I
thought there would be a way which would allow me to show the user
that he's got to wait by means of a text like "Please wait..." and
when showing the results get rid of that text.
When I use flush instead, some part of the website already shows and
some part does not, which leads the user to assume, that there'S been
an error.

Does anybody have an idea how to handle that?

This is one of the reasons that HTML sucks so bad as a user interface.
Could you do a simple front end in Flash or Java? It could be just a
little box that says "Please wait", then disappears when the PHP
script is done.
Jul 17 '05 #7

P: n/a
Thank you for your answer.
Your clients do not mind having a browser window open for 20 minutes
with the words "Please wait ..."? !!! I would! They don't mind, as they know that processing some hundred thousand
database entries and doing some complex calculations takes a lot of
time and usually should be done with a datawarehouse system, which
they don't want to pay for.

Anyway... <OT trolling="I don't know JavaScript">

send a <p id="pleasewait">Please wait...</p>
flush (maybe send a few spaces to fill browser cache)
process for 20 minutes
send javascript to turn "pleasewait" paragraph invisible/hidden

</OT>

Intersting idea! Do you know how I could trigger the turn invisible
part? Because I haven't. :-(

Thanks
Lars
Jul 17 '05 #8

P: n/a
Thanks for your answer.
This is one of the reasons that HTML sucks so bad as a user interface.
Could you do a simple front end in Flash or Java? It could be just a
little box that says "Please wait", then disappears when the PHP
script is done.


Do you know what I could use as an event-hanlder to tell flash or
java, that it should disappear, as the php is done?

Thanks
Lars
Jul 17 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.