PHP实现discuz安装进度显示
PHP #discuz #进度2012-10-23 10:05
以下代码实现discuz安装进度显示,比如什么什么数据表创建完成,什么什么文件创建完成!
大家看看。
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Discuz! 安装向导 http://yige.org </title>
<style type="text/css">
body{ padding:5px 0; background:#FFF; text-align:center; }
body, td, input, textarea, select, button{ color:#666; font:12px/1.5 Verdana, Tahoma, Arial, 'Microsoft Yahei', 'Simsun', sans-serif; }
.container{ overflow:hidden; margin:0 auto; width:700px; height:auto !important;text-align:left; border:1px solid #B5CFD9; }
.main{ padding:20px 20px 0; background:#F7FBFE url(bg_repx.gif) repeat-x 0 -194px; }
.main h3{ margin:10px auto; width:75%; color:#6CA1B4; font-weight:700; }
#notice { overflow: hidden; margin: 20px; padding: 5px; height: 300px; border: 1px solid #B5CFD9; text-align: left; }
</style>
<meta name="Copyright" content="Comsenz Inc.">
</head>
<body><div class="container">
<div class="main"><script type="text/javascript">
function showmessage(message) {
document.getElementById('notice').innerHTML += message + '<br/>';
document.getElementById('notice').scrollTop = 100000000;
}
</script>
<div id="notice"></div>
<?php
//检测完成后显示的信息
function showjsmessage($message) {
echo '<script type="text/javascript">showmessage(''.addslashes($message).' ');</script>'."
";
flush();
ob_flush();
}
//模拟初始化数据表
for ($i = 1; $i <= 50; $i++) {
showjsmessage("建立数据表 {$i} ... 成功");
sleep(rand(0, 1));
}
?>
</div>
</div>
</body>
</html>效果图:
相关文章
- PHP分页类 2012/10/23
- php关联数组快速排序 2012/10/21
- php获取数组中重复数据的函数 2012/10/20
- PHP+MYSQL身份验证的方法 2012/10/20
- PHP找不到php_curl.dll的解决方法 2012/10/20
- PHP注入:谈MySql的SQL注入 2012/10/12
- php注入基本步骤 2012/10/11
- 使用php mongodb扩展时需要注意的地方 2012/09/13
- php函数file_get_contents超时处理 2012/07/13
- 注册页面用php来验证用户名是否存在。 2012/07/13