<?phpecho date('h:i:s') . "<br />";?><IFRAME width="100" height="100" border=0 name=top marginWidth=0 frameSpacing=0 marginHeight=0 src="2.php" frameBorder=0 noResize scrolling=no vspale="0"></IFRAME><?phpsleep(3);//暂停:把进程挂起一段时间?>
这是体系问题
IFRAME 要在发送到浏览器以后,由浏览器执行
但你把 php 挂起了 3 秒(sleep(3)),于是 IFRAME 要到 php 重新运行页后才会被发送
sleep是php的方法,而html是必须等php执行完才返回给浏览器的。
你可以这样写来实现。
<?phpecho date('h:i:s') . "<br />";?><IFRAME width="100" height="100" border=0 name=top marginWidth=0 frameSpacing=0 marginHeight=0 src="2.php" frameBorder=0 noResize scrolling=no vspale="0"></IFRAME><?php// 加入这两句先把之前的内容输出到浏览器ob_flush();flush();sleep(3);//暂停:把进程挂起一段时间echo 'next';?>楼上的还是不行,我想要的是,sleep不影响到IFRAME里面的2.php
当然不行!因为你的思路本身就是错误的
每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号