当前位置:Gxlcms > PHP教程 > PHP设置进度条的方法,PHP设置进度条方法_PHP教程

PHP设置进度条的方法,PHP设置进度条方法_PHP教程

时间:2021-07-01 10:21:17 帮助过:3人阅读

PHP设置进度条的方法,PHP设置进度条方法


本文实例讲述了PHP设置进度条的方法。分享给大家供大家参考。具体如下:

  1. <style type="text/css"><!--
  2. div {
  3. margin: 1px;
  4. height: 20px;
  5. padding: 1px;
  6. border: 1px solid #000;
  7. width: 275px;
  8. background: #fff;
  9. color: #000;
  10. float: left;
  11. clear: right;
  12. top: 38px;
  13. z-index: 9
  14. }
  15. .percents {
  16. background: #FFF;
  17. border: 1px solid #CCC;
  18. margin: 1px;
  19. height: 20px;
  20. position:absolute;
  21. width:275px;
  22. z-index:10;
  23. left: 10px;
  24. top: 38px;
  25. text-align: center;
  26. }
  27. .blocks {
  28. background: #EEE;
  29. border: 1px solid #CCC;
  30. margin: 1px;
  31. height: 20px;
  32. width: 10px;
  33. position: absolute;
  34. z-index:11;
  35. left: 12px;
  36. top: 38px;
  37. filter: alpha(opacity=50);
  38. -moz-opacity: 0.5;
  39. opacity: 0.5;
  40. -khtml-opacity: .5
  41. }
  42. -->
  43. </style>
  44. <?php
  45. if (ob_get_level() == 0) {
  46. ob_start();
  47. }
  48. echo str_pad('Loading... ',4096)."<br>\n";
  49. for ($i = 0; $i < 25; $i++) {
  50. $d = $d + 11;
  51. $m=$d+10;
  52. //This div will show loading percents
  53. echo '' . $i*4 . '% complete';
  54. //This div will show progress bar
  55. echo ' ';
  56. flush();
  57. ob_flush();
  58. sleep(1);
  59. }
  60. ob_end_flush();
  61. ?>
  62. Done.

希望本文所述对大家的php程序设计有所帮助。

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/1028974.htmlTechArticlePHP设置进度条的方法,PHP设置进度条方法 本文实例讲述了PHP设置进度条的方法。分享给大家供大家参考。具体如下: htmlheadstyle type="text/...

人气教程排行