By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,227 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

Loading progress bar

P: n/a
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

Oct 30 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Hi,

You could redirect using javascript. For example:

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

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

http://www.dynamicdrive.com/dynamici...rogressbar.htm
http://www.dynamicdrive.com/dynamici...lprogress2.htm

AJAX upload progress meter in PHP:

http://wiki.bluga.net/HTML_AJAX/ProgressMeter

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
Oct 31 '06 #2

P: n/a
Actually, there are bunch of ways of doing this. Two of best ways:

1) IFRAMES
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.

CJ

"Aggelos" <dj*****@gmail.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.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

Oct 31 '06 #3

P: n/a
Thank you for your responses.

Oct 31 '06 #4

P: n/a
1) IFRAMES
I don't know what I could do exactly with I frames. can you give
areally simple example ?
2) UberUploader(check 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(using 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($newsleterArray);
foreach($newsleterArray as $key =$value) {
count++;
$pbarExampleClass->increaseprogressbar($count,$totalRecords);
sendNewsletter($value['email']);
.....
}
>From all that I need the pbarExampleClass class. If you have something
in mind.
Thanks

Oct 31 '06 #5

P: n/a
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 =
newWidth;
myReference.height = newHeight + noPx; myReference.pixelHeight =
newHeight;
}

<?php
echo '<script>rSDiv(\'myDiv\','.($this->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.

Oct 31 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.