PHP Progess bar script?

Discussion in 'PHP' started by wvccboy, May 5, 2006.

  1. #1
    Are there any easy to integrate progess bars in 100% PHP?
    I haven't seen any recently and was wondering if anyone could recommend any.

    thanks
     
    wvccboy, May 5, 2006 IP
  2. Edmunds

    Edmunds Peon

    Messages:
    136
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What sort of a progress bar are you looking for?

    There is no way to display a progress bar using PHP, however, using a combination of technologies, such as Perl or AJAX, you can get the results.

    If you're looking for an upload progress bar, then http://www.raditha.com/megaupload/ is one, and this is an ajax one: http://www.devpro.it/upload_progress/
     
    Edmunds, May 5, 2006 IP
  3. mines

    mines Well-Known Member

    Messages:
    1,127
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    160
    #3
    I imagine that if you had a script that took very long, you may be able to achieve a progress bar just in php by using something like flush() or something similar. Not 100% sure on this, or even why you only want to do it in php.
     
    mines, May 7, 2006 IP
  4. sadcox66

    sadcox66 Spirit Walker

    Messages:
    496
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It needs to be JavaScript or an animated .gif
     
    sadcox66, May 7, 2006 IP
  5. stuartc1

    stuartc1 Active Member

    Messages:
    125
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    75
    #5
    Progress bars are tricky using any technology for the web (perhaps java would work ok though) - the main reason is when to tell that true progress - you can fake it using an animated gif or javascript loading single blocks, but it would not be a genuine guide to how long a connetion could take.

    I would be done using php, but you would also need to use Ajax to talk to php from the browser.
     
    stuartc1, May 7, 2006 IP
  6. frisby

    frisby Well-Known Member

    Messages:
    1,378
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    140
    #6
    It's all soo complicated to do that kind of progress bar, which will work correctly. But i saw one time once, but i think it works only in FF (not sure), but i don't know now about it anymore.
     
    frisby, May 7, 2006 IP
  7. mines

    mines Well-Known Member

    Messages:
    1,127
    Likes Received:
    19
    Best Answers:
    0
    Trophy Points:
    160
    #7
    And it also will technically slow the loading down... Although probably not much. But on slow connection/really slow computers it will.
     
    mines, May 7, 2006 IP
  8. wvccboy

    wvccboy Notable Member

    Messages:
    2,632
    Likes Received:
    81
    Best Answers:
    1
    Trophy Points:
    250
    #8
    ok then.. Php and Javascript. Is that easier?
     
    wvccboy, May 7, 2006 IP
  9. frisby

    frisby Well-Known Member

    Messages:
    1,378
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    140
    #9
    With just php, that u defenetly can't, but with this combination is also so difficult... :rolleyes:
     
    frisby, May 7, 2006 IP
  10. tech86

    tech86 Peon

    Messages:
    83
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Using just php, as far as I am aware it would be very difficult or not possible. However if you combine php + javascript (or ajax) you could create a really impressive progress bar.

    Take a look at [I CANT POST LINKS YET, PM ME]
     
    tech86, May 8, 2006 IP
  11. DrQuincy

    DrQuincy Peon

    Messages:
    28
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Believe it or not there is. You can use flush() - there is a working example on the php.net user notes. I wouldn't recommend it though as some browser - server connections don't like forced flushes (I've tried it, it's very unreliable). It would be much better to use AJAX.
     
    DrQuincy, May 10, 2006 IP