How do I show a progress-bar?
Moderator: General Moderators
How do I show a progress-bar?
Hey,
I have searched google and also read a few books on php now.
Im getting frustarted and ready to start learning a diffrent lanuage.
I am trying to make a progress bar my php script is carrying out a lengthy task.
I have came across html progress as a pear package.
Will this do the job?
I have searched google and also read a few books on php now.
Im getting frustarted and ready to start learning a diffrent lanuage.
I am trying to make a progress bar my php script is carrying out a lengthy task.
I have came across html progress as a pear package.
Will this do the job?
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
- mudkicker
- Forum Contributor
- Posts: 479
- Joined: Wed Jul 09, 2003 6:11 pm
- Location: Istanbul, TR
- Contact:
isnt't it an un-optimized thing? i think it overloads the server too much? and even the internet connection of user..kettle_drum wrote:I would use a mixture of javascript and php in an iframe. Have the javascript resize the lenght of the completed section by reloading the iframe to see how far the php script is coming along.
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
mudkicker: Yeah of course it is! But if you have to show one thats probably the more accurate method. If it was my project i wouldnt use a real progress bar, but simply an animated gif to show some kind of loading process and then put under "Please Wait".
If its a lenghty process then users should be aware that it will take time, and dont need to see a % scale of the current process. Or depending on what the script does, im sure some of it could be done before the user presses a button - so see what you can get a cron script to run every so often and then you have some of the data processed already.
If its a lenghty process then users should be aware that it will take time, and dont need to see a % scale of the current process. Or depending on what the script does, im sure some of it could be done before the user presses a button - so see what you can get a cron script to run every so often and then you have some of the data processed already.
there is also flush(), like I have said I am a newbie to php so if this is absolutey crazy then well got to learn somehow.
I can get it to flush() and using ob_flush() at the same time problem is it needs to be to be a fair amount of characters.
A loop looping the text loading 50 times onto the screen seems a bit much. Would it be possible to buffer a transparent gif with one line of text?
I can get it to flush() and using ob_flush() at the same time problem is it needs to be to be a fair amount of characters.
A loop looping the text loading 50 times onto the screen seems a bit much. Would it be possible to buffer a transparent gif with one line of text?
if you are going to use Iframes then when you submit the form you can just set the src of an image tag to load the animated gif, which is what I will be doing because of some server intesive graphic creation I will have my current project doing. I have also seen this technique used on some other graphic producing sites especially if there will be lots of users.
- mudkicker
- Forum Contributor
- Posts: 479
- Joined: Wed Jul 09, 2003 6:11 pm
- Location: Istanbul, TR
- Contact:
Yes, this is the way I always do it. I think it's the easiest & best one.kettle_drum wrote:mudkicker: Yeah of course it is! But if you have to show one thats probably the more accurate method. If it was my project i wouldnt use a real progress bar, but simply an animated gif to show some kind of loading process and then put under "Please Wait".
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England