易截截图软件、单文件、免安装、纯绿色、仅160KB

PHP进度条效果

用PHP实现进度条效果。
<?php
set_time_limit(0);
echo '<h2>正在安装,请稍后...</h2>',
'<div style="border:1px solid #000;width:500px;"><div id="progress_bar">loading...</div></div>';
for($i=1;$i<=100;$i++){
$width = '500';
$width = ceil(($i/100)*$width);
echo '<mce:script type="text/javascript"><!--
',
'var progress_bar = document.getElementById("progress_bar");',
'progress_bar.style.background="#ff0000";',
'progress_bar.style.width ="'.$width.'px";',
"progress_bar.innerHTML = '{$i}%';",
'
// --></mce:script>';
sleep(1);
flush();
}
echo 'done';
?>


相关文档:

php有关的几种常见安全详解

(1) 打开php的安全模式
php的安全模式是个非常重要的内嵌的安全机制,能够控制一些php中的函数,比如system(),
同时把很多文件操作函数进行了权限控制,也不允许对某些关键文件的文件,比如/etc/passwd,
但是默认的php.ini是没有打开安全模式的,我们把它打开:
safe_mode = on
(2) 用户组安全
当safe_mode打开时, ......

PHP获得类常量,属性,方法列表

<?php
$p=new ReflectionClass(类对象);
$constants=$p->getConstants();//const 定义常量
$properties=$p->getProperties();//所有变量属性
$methods=$p->getMethods();//所有方法
//全部以数组形势返回
?> ......

21个实用便利的PHP代码

1. PHP可阅读随机字符串
此代码
将创建一个可阅读的字符串,使其更接近词典中的单
词,实用且具有密码验证功能。
/**************
[email=*@length]*@length[/email] - length of random string (must be a
multiple of 2)
**************/
function readable_random_string($length = 6){
    $conso= ......

PHP Floating point precision

Floating point precision
It is typical that simple decimal fractions like 0.1
or
0.7
cannot be converted into their internal binary
counterparts without a small loss of precision. This can lead to
confusing
results: for example, floor((0.1+0.7)*10)
will usually
return 7
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号