Loading progress bar

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello I am doing sevreral scripts like sending a newsletter that might
take a while to finish first to prevent the browser from timing out and
to keep the user informed of the process progress I want to use a
loader progress bar. I did a plain expanding gif but the problem is
that it prevents me at the end from redirecting.

Do you have in mind any nice script that might do that? AJAX would be a
good solution. Or something that will pop up... I don't know what to
think. It is the first time I am doing that.
The progress depends on the loop progress ... so a simple counter and
count(array) would be enough variables to create something.

If you've done something similar you'll know what I am talking about.

Re: Loading progress bar


You could redirect using javascript. For example:

    echo '<script type="text/javascript">window.location =

An image would work. Javascript progress meters are available too:


AJAX upload progress meter in PHP:


Hope that's helpful.

Aggelos wrote:
Quoted text here. Click to load it

Aggelos wrote:
Quoted text here. Click to load it

Re: Loading progress bar

Thank you for your responses.

Re: Loading progress bar

Actually, there are bunch of ways of doing this.  Two of best ways:

2) UberUploader(check out sourceforge.net for this one)
3) Script that uses a backend on the server and some javascript(using an  
asyncronous means)

To me, UberUpload is the easiest to implement.


Quoted text here. Click to load it

Re: Loading progress bar

Quoted text here. Click to load it
I don't know what I could do exactly with I frames. can you give
areally simple example ?
Quoted text here. Click to load it
That is perl and is for uploads which I can't see how am I going to
apply on a loop.
Quoted text here. Click to load it
I don't understand whatyou mean.
Remember that the progress bar I need is just for displaying the
sending progress of a newsletter for example.


$totalRecords = count($newsleterArray);
foreach($newsleterArray as $key => $value) {

Quoted text here. Click to load it
in mind.

Re: Loading progress bar

OK thanks everybody
I finally did it with javascript, updating the width of a div using the
folowing script:
            function getRefToDiv(divID,oDoc) {
              if( document.getElementById ) {
                return document.getElementById(divID); }
              if( document.all ) {
                return document.all[divID]; }
              if( !oDoc ) { oDoc = document; }
              if( document.layers ) {
                if( oDoc.layers[divID] ) { return oDoc.layers[divID]; } else {
                  //repeatedly run through all child layers
                  for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) {
                    //on success, return that layer, else return nothing
                    y = getRefToDiv(divID,oDoc.layers[x].document); }
                return y; } }
              return false;
function rSDiv(oName,newWidth,newHeight) {
                var myReference = getRefToDiv(oName), noPx = document.childNodes ?
'px' : 0;
                if( myReference.style ) { myReference = myReference.style; }
                if( myReference.resizeTo ) { myReference.resizeTo( newWidth,
newHeight ); }
                myReference.width = newWidth + noPx; myReference.pixelWidth =
                myReference.height = newHeight + noPx; myReference.pixelHeight =

echo '<script>rSDiv('myDiv','.($this->percent / 100) *
I'd like to know if there is an AJAX equivalent but I don't have time
to look around any more.
Thank you.

Site Timeline