PHP设置进度条的方法
2015-07-08 00:00
615 查看
本文实例讲述了PHP设置进度条的方法。分享给大家供大家参考。具体如下:
<html> <head> <style type="text/css"><!-- div { margin: 1px; height: 20px; padding: 1px; border: 1px solid #000; width: 275px; background: #fff; color: #000; float: left; clear: right; top: 38px; z-index: 9 } .percents { background: #FFF; border: 1px solid #CCC; margin: 1px; height: 20px; position:absolute; width:275px; z-index:10; left: 10px; top: 38px; text-align: center; } .blocks { background: #EEE; border: 1px solid #CCC; margin: 1px; height: 20px; width: 10px; position: absolute; z-index:11; left: 12px; top: 38px; filter: alpha(opacity=50); -moz-opacity: 0.5; opacity: 0.5; -khtml-opacity: .5 } --> </style> </head> <body> <?php if (ob_get_level() == 0) { ob_start(); } echo str_pad('Loading... ',4096)."<br />\n"; for ($i = 0; $i < 25; $i++) { $d = $d + 11; $m=$d+10; //This div will show loading percents echo '<div class="percents">' . $i*4 . '% complete</div>'; //This div will show progress bar echo '<div class="blocks" style="left: '.$d.'px"> </div>'; flush(); ob_flush(); sleep(1); } ob_end_flush(); ?> <div class="percents" style="z-index:12">Done.</div> </body> </html>
希望本文所述对大家的php程序设计有所帮助。
相关文章推荐
- 一个PHP实现的轻量级简单爬虫
- PHP使用CURL模拟登录的方法
- PHP通过串口实现发送短信
- PHP实现图片自动清理的方法
- PHP实现多文件上传的方法
- PHP使用pear自带的mail类库发邮件的方法
- php实现数组中索引关联数据转换成json对象的方法
- php将html转成wml的WAP标记语言实例
- PHP+Mysql基于事务处理实现转账功能的方法
- PHP实现最简单的聊天室应用
- vsftpd 530 Login incorrect 解决
- php常用函数收集并附解释说明
- [CVE-2014-8959] phpmyadmin任意文件包含漏洞分析
- php魔术方法__set和__get,__isset,__unset的用法
- phpdoctor 安装,配置,生成文档
- PHP 获取表单数据与HTML嵌入PHP脚本
- php不经常用到的函数和类中的函数(一)
- PHP开发者应了解的24个超酷的PHP库(微框架)
- 求连续子数组最大和问题的两种解法_PHP实现
- there was no endpoint listening at net.pipe://localhost/PreviewProcessingService/ReportProcessing