php 仿DZ,PW数据库安装

主要是用到了 flush();  ob_flush(); usleep();
<div class="main">
<div class="btnbox"><textarea name="notice" style="width: 1200px; height:960px;" readonly="readonly" id="notice"></textarea></div>
<div class="btnbox marginbot">
<input type="button" name="submit" value="正在执行……" disabled style="height:25px;" id="laststep" onclick="initinput()">
</div>
<script type="text/javascript">
function showmessage(message) {
document.getElementById('notice').value += message + "\r\n";
}
</script>

<?php
$str="table";
$length=100;//100张表
$table_array = array();
for($i=0;$i<$length;$i++)
{
$table_array[]=$str.$i;
}
foreach($table_array as $tab)
{
echo "<script type='text/javascript'>showmessage('安装{".$tab."}成功')</script>";
flush(); 
ob_flush();
//sleep(1);//睡1s
usleep(100000);
}
echo "安装完成<br>";
?>

你可能感兴趣的:(php 仿DZ,PW数据库安装)