0

I am looking for a way to have a counter (which is giving user feedback during a lengthy process). That is easy enough, but the thing is that the counter should display its digits always in the same screen location.

The process consists of about 50,000 repeated steps. Is such a counter possible in PHP? Or in a combination with Javascript? I would so much love to get a working example.

This is the rough logic:

$Counter = 0;
While ($counter < 50000) {
   $x = DoSomething(); 
   echo $counter; // **always in the same location!**
   Counter++;
} ;

Hoping for the best!

modul
  • 9
  • 1

1 Answers1

0

Obviously, all (PHP) problems have their solution, hidden somewhere here on StackOverflow. My thingy about having Echo use always the same location on screen, has been answered here: Show progress for long running PHP script . About halfway down, there is a beautiful neat solution, without Javascript of Ajax, only in PHP. For me it does the trick!

Thanks, Stack.

modul
  • 9
  • 1