computerman
Posts: 27
|
| Posted: 05/07/2010, 3:41 AM |
|
As given in title, how do you make it ?
lets say we have a multi step progress in server side of onclick, so user will know about the results of each step 'virtually realtime'.
here is what I wish to make:
finding records...(here waits till progress finished) done.
changing values.. (here waits till progress finished) done
process was successful.
or another example:
finding records..done
changing values..failed!
progress failed!
I can only 'echo' then 'exit' from whole progress.
Shortly: How to make it so when user submitted form will see a page about every progress, and server will echo results of each step?
thank you in advance,
oh, This was one of easy-to-show, hard-to-explain subject for me :)
_________________
"whoever is a cruel, must be an old downtrod who has got authority,
whoever is a downtrod, must be an old cruel who has lost authority. "
An Oriental Saying |
 |
 |
computerman
Posts: 27
|
| Posted: 05/07/2010, 3:52 AM |
|
And before forget, I know It can be made with help of ajax , but I remember those dark times of Internet, and this behavior was exist (I remember this way from account creation pages of several free hosting companies like hypermart etc.), In other words I need a primitive but working solution without spending hundreds of tryouts to integrate ajax stuff into CCS.
_________________
"whoever is a cruel, must be an old downtrod who has got authority,
whoever is a downtrod, must be an old cruel who has lost authority. "
An Oriental Saying |
 |
 |
datadoit
|
| Posted: 05/07/2010, 5:34 AM |
|
One little trick you could use is to place a borderless text area on
your page, then periodically update the value of the text area via
javascript from your PHP code. Something like:
<?php
echo "javascript: document.forms["YourForm"].YourTextArea.value =
document.forms["YourForm"].YourTextArea.value+'\nfinding records ...';";
?>
The other way is to use an AJAX method. :) What you're likely seeing
from the host control panel is perl/cgi scripting.
|
|
|
 |
computerman
Posts: 27
|
| Posted: 05/07/2010, 6:52 AM |
|
datadoit, thank you for this trick, I'll give a try.
But also when I was googling I found existence of "flush()" function (being newbie is tough :))
which was given here:
Quote :http://www.lejdborg.se/index.php/2009/10/real-time-output-to-the-screen-using-php/
But I don't know how to go further with this code.
maybe could It be a good approach of my question?
Any help will be greatly appreciated!
_________________
"whoever is a cruel, must be an old downtrod who has got authority,
whoever is a downtrod, must be an old cruel who has lost authority. "
An Oriental Saying |
 |
 |
datadoit
|
| Posted: 05/07/2010, 8:29 AM |
|
Yes there's flush() and obflush(). It's what CodeCharge does at the end
of their magic. However, you may experience some goofyness by flushing
midstream.
|
|
|
 |
wadus
Posts: 5
|
| Posted: 05/09/2010, 10:06 AM |
|
If you use an Update Panel, it does that for you automatically.
|
 |
 |
computerman
Posts: 27
|
| Posted: 05/10/2010, 7:37 AM |
|
Quote wadus:
If you use an Update Panel, it does that for you automatically.
I would be grateful if you show me a little example about how to make this.
_________________
"whoever is a cruel, must be an old downtrod who has got authority,
whoever is a downtrod, must be an old cruel who has lost authority. "
An Oriental Saying |
 |
 |
|