+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: php Progress bar

  1. #1
    ruicos is offline x10Hosting Member ruicos is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    9

    php Progress bar

    I would like to create a progress bar in php. Do you know to do that?

  2. #2
    Salvatos's Avatar
    Salvatos is offline x10 Lieutenant Salvatos is an unknown quantity at this point
    Join Date
    Jun 2006
    Location
    Québec, Canada
    Posts
    271

    Re: php Progress bar

    You mean during a download? (I don't know how but I figure that info would help others help you. My guess is you have to use Flash to do that, though.)

  3. #3
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: php Progress bar

    If you want to make a moving progress bar for something, you have to use some client-side scripting (javascript, flash, w/e) but not php
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  4. #4
    nyanko's Avatar
    nyanko is offline x10Hosting Member nyanko is an unknown quantity at this point
    Join Date
    Jul 2008
    Location
    In front of my pc
    Posts
    57

    Re: php Progress bar

    Ajax + Php Still I dont know how to Im still trying to learn Ajax u_u
    Hago banners/logos/diseños por comida y/o links a mi sitio :P.
    Making banners/logos/designs for food/backlink to my site :P.

  5. #5
    ruicos is offline x10Hosting Member ruicos is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    9

    Re: php Progress bar

    I want to run a php script. While the php script is running it would appear a progress bar. For example if i have a flash progress bar how can i call it from the php script?

  6. #6
    sunils's Avatar
    sunils is offline x10 Spammer sunils is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Chennai ,India
    Posts
    2,264

    Re: php Progress bar

    As marshian said, you need to use only client side scripts.. You can try Ajax + php progress bar also.. google for it and you can find so many info about it.
    [LEFT][B]Sunil Sankar
    -------------------------------------------------------------------------

  7. #7
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: php Progress bar

    BUT if the PHP script is running, nobody will be able to see the progress bar anyway.
    You can show flash using the following:
    Code:
    echo "<object width='400' height='100'>
    <param name='movie' value='flashbar.swf'>
    <embed src='flashbar.swf' width='40' height='100'>
    </embed></object>";
    But understand that the bar will not be seen until PHP has finished execution. PHP is a server side only language. Everything is done on the server, and the client only sees the results.
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  8. #8
    sunils's Avatar
    sunils is offline x10 Spammer sunils is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Chennai ,India
    Posts
    2,264

    Re: php Progress bar

    Using ajax you can do that.. you have uploaders with progress bar which uses ajax technology. It uses the php code to upload the code and simultaneously shows the progress bar.
    [LEFT][B]Sunil Sankar
    -------------------------------------------------------------------------

  9. #9
    nyanko's Avatar
    nyanko is offline x10Hosting Member nyanko is an unknown quantity at this point
    Join Date
    Jul 2008
    Location
    In front of my pc
    Posts
    57

    Re: php Progress bar

    as a tweak you can call the swf thing at the beginning of your php script, then clear it at the end.
    Hago banners/logos/diseños por comida y/o links a mi sitio :P.
    Making banners/logos/designs for food/backlink to my site :P.

  10. #10
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: php Progress bar

    You can do something like...
    when the php script starts, set a session variable to 0 (0%)
    while the php script runs, change that number (0 -> 100%)
    meanwhile, ANOTHER PAGE shows the progress bar
    using javascript it requests a 3rd php page which returns the session variable
    again using javascript, the scrollbar is updated.

    Example (in my-code = non-existing language)

    do-something-page.php
    Code:
    $_SESSION["prog"] = 0;
    for(blahblah) {
    $_SESSION["prog"]++;
    }
    pageThatIsCalledByJavascript.php
    Code:
    echo $_SESSION["prog"];
    statusbarPage.php
    Code:
    <html blahblah>
    <script>
    ProgressBar status = new ProgressBar();
    status.value = 0;
    setTimeout(update, 1000);
    function update() {
    newstatus = getPageContents("pageThatIsCalledByJavascript.php");
    status.value = newstatus;
    }
    </script>

    <3 me-code ;p

    - Marshian
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Ever Been Suspended For Using PHP?
    By dragoneye_xp in forum Off Topic
    Replies: 26
    Last Post: 08-16-2009, 07:17 PM
  2. [PHP] Variables in PHP
    By Bryon in forum Tutorials
    Replies: 15
    Last Post: 01-29-2009, 09:46 AM
  3. currently have an application pending php
    By biomasti in forum Free Hosting
    Replies: 1
    Last Post: 09-03-2008, 01:58 PM
  4. php errors galore
    By DMG Online in forum Scripts & 3rd Party Apps
    Replies: 9
    Last Post: 05-17-2008, 06:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers