Loading progress bar

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Aggelos

    #1

    Loading progress bar

    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.
    Thanks

  • petersprc@gmail.com

    #2
    Re: Loading progress bar

    Hi,

    You could redirect using javascript. For example:

    echo '<script type="text/javascript">win dow.location =
    \'done.php\'</script>';

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




    AJAX upload progress meter in PHP:



    Hope that's helpful.

    Aggelos wrote:
    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.
    Thanks
    Aggelos wrote:
    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.
    Thanks

    Comment

    • draken

      #3
      Re: Loading progress bar

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

      1) IFRAMES
      2) UberUploader(ch eck out sourceforge.net for this one)
      3) Script that uses a backend on the server and some javascript(usin g an
      asyncronous means)

      To me, UberUpload is the easiest to implement.

      CJ

      "Aggelos" <djjelly@gmail. comwrote in message
      news:1162245542 .343076.266810@ e3g2000cwe.goog legroups.com...
      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.
      Thanks
      >

      Comment

      • Aggelos

        #4
        Re: Loading progress bar

        Thank you for your responses.

        Comment

        • Aggelos

          #5
          Re: Loading progress bar

          1) IFRAMES
          I don't know what I could do exactly with I frames. can you give
          areally simple example ?
          2) UberUploader(ch eck out sourceforge.net for this one)
          That is perl and is for uploads which I can't see how am I going to
          apply on a loop.
          3) Script that uses a backend on the server and some javascript(usin g an
          asyncronous means)
          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.

          So:

          count=0;
          $totalRecords = count($newslete rArray);
          foreach($newsle terArray as $key =$value) {
          count++;
          $pbarExampleCla ss->increaseprogre ssbar($count,$t otalRecords);
          sendNewsletter( $value['email']);
          .....
          }
          >From all that I need the pbarExampleClas s class. If you have something
          in mind.
          Thanks

          Comment

          • Aggelos

            #6
            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(div ID,oDoc) {
            if( document.getEle mentById ) {
            return document.getEle mentById(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.len gth; x++ ) {
            //on success, return that layer, else return nothing
            y = getRefToDiv(div ID,oDoc.layers[x].document); }
            return y; } }
            return false;
            }
            function rSDiv(oName,new Width,newHeight ) {
            var myReference = getRefToDiv(oNa me), noPx = document.childN odes ?
            'px' : 0;
            if( myReference.sty le ) { myReference = myReference.sty le; }
            if( myReference.res izeTo ) { myReference.res izeTo( newWidth,
            newHeight ); }
            myReference.wid th = newWidth + noPx; myReference.pix elWidth =
            newWidth;
            myReference.hei ght = newHeight + noPx; myReference.pix elHeight =
            newHeight;
            }

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

            Comment

            Working...