473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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

Oct 30 '06 #1
5 4021
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
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
Thank you for your responses.

Oct 31 '06 #4
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Robbie | last post by:
Even though this is not very important it would be nice to get working. Basically all I want to do is continuously write to the same line. So I could have a little rotating text thing showing...
2
by: Steve - DND | last post by:
There has to be an answer out there somewhere for this, but I couldn't find it in Google anywhere. I have a page with two IFrames. In IFrame#1 I have a link that looks like so: <a...
4
by: Adrian MacNair | last post by:
Hi, I created an image gallery which displays 63 images in a slideshow. The problem is that the show was slow because each image loaded one at a time during the show. No problem right? I just...
4
by: zborisau | last post by:
Hey good people, I've been given a problem to solve recently - and stuck with the solution for a good 4 days already. i have a link which leads to popup window. the purpose of that popup...
0
by: Timo | last post by:
My (intranet) aspx page finishes loading but the progress bar continues to advance very very very slowly, i.e. a new chunk on the bar is added 10 seconds or so, and then progress bar stops about...
5
by: Cerebrus | last post by:
Hi all, I have an Windows application in which the startup form is called "MainForm". Now when this form loads, I need to do some intensive tasks like loading and parsing an XML file, that takes...
2
by: mupeti | last post by:
Hi! How can i do that progress image (Update Progress) is visible while image (with big size) is loading? Thank you for help! Peter
3
by: Blacky | last post by:
HI, I need to show a progress bar/message till the datagrid is fully loaded and shown in the screen.Currently, i have witten a javascript with time specified and shows a message 'Please wait while...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.