This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

PHP progressbar

By: a guest on Feb 2nd, 2012  |  syntax: PHP  |  size: 0.37 KB  |  views: 67  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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>
clone this paste RAW Paste Data