Forum Moderators: coopster

Message Too Old, No Replies

How to process items that "happen" farther down in the code.

         

erikcw

1:42 am on Jun 3, 2004 (gmt 0)

10+ Year Member



Hi,

I have a function that counts the number of lines in a textarea/variable. (\n)
The function is executed at the top of the webpage, but the textarea where the processing takes place is a couple of hundred lines later.

Because of this the counter is always behind. It catches up onces the form is POSTed to the next step.

Is threr a way to process the results of a function that happens later - some sort of pause perhaps?

Thanks!

WhosAWhata

2:04 am on Jun 3, 2004 (gmt 0)

10+ Year Member



couldn't you just move the function to the bottom of the code?
if you want to pause the command is
sleep(number of seconds);
i don't think this is what you need though
perhaps yo ucould provide an example

httpwebwitch

3:05 am on Jun 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want immediate feedback from the contents of a textarea, you might be seeking a javascript solution, not a PHP function.

yes, more detail is needed

mykel79

11:14 am on Jun 5, 2004 (gmt 0)

10+ Year Member



Like httpwebwitch said, you need to use javascript. Once a php script returns the results, there is no way to interact with it (unless by posting the form again). That's why you need a client side script.

erikcw

4:55 pm on Jun 5, 2004 (gmt 0)

10+ Year Member



Thanks guys.

E