Advertisement
Guest User

PHP progressbar

a guest
Feb 2nd, 2012
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.37 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title></title>
  4. </head>
  5. <body>
  6. <?php
  7. if(isset($_GET['progress_key'])) {
  8.     $status = apc_fetch('upload_'.$_GET['progress_key']);
  9.     if($status['current']<1)
  10.     {
  11.         $percent=0;
  12.         echo $percent;
  13.     }
  14.     else
  15.     {
  16.         $percent = round($status['current']/$status['total']*100);
  17.         echo $percent;
  18.     }
  19. }
  20. ?>
  21. <?php
  22. header("Percent:".$percent);
  23. ?>
  24. </body>
  25. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement