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

PHP验证码生成脚本(5位数字png格式)


<?php
header("Content-Type:image/png");
srand((double)microtime()*1000000);
$img_height=20;
$img_width=60;
$im=@imagecreate($img_width,$img_height) or die("不能初始化GD文件流");
$background_color=imagecolorallocate($im,255,255,255);
$text_color=imagecolorallocate($im,233,14,91);
//绘制干扰雪花
for($i=1;$i<=100;$i++)
{
imagestring($im,1,mt_rand(1,$img_width),mt_rand(1,$img_height),"*",imageColorAllocate($im,mt_rand(200,255),mt_rand(200,255),mt_rand(200,255)));
}
while(($num=rand()%100000)<10000);
//将随即产生的验证码保存在session中,方便以后使用
//session_start();
$_SESSION["num"]=null;//验证码刷新
$_SESSION["num"]=$num;
//绘制字符从到图像
imagestring($im,4,15,2,$num,$text_color);
imagepng($im);
imagedestroy($im);
?>


相关文档:

PHP: How to Get the Current Page URL

Sometimes, you might want to get the current page URL that is shown
in the browser URL window. For example if you want to let your visitors
submit a blog post to Digg you need to get that same exact URL. There
are plenty of other reasons as well. Here is how you can do that.
Add the followin ......

PHP htmlspecialchars() 函数


定义和用法
htmlspecialchars() 函数把一些预定义的字符转换为 HTML 实体。
预定义的字符是:
& (和号) 成为 &amp;
" (双引号) 成为 &quot;
' (单引号) 成为 &#039;
< (小于) 成为 &lt;
> (大于) 成为 &gt;
语法
htmlspecialchars(string,quotestyle,character-se ......

26款国外开源PHP建站程序


开源建站程序让编程高手和只懂打字上网的人都可以快速建立一个功能强大、界面漂亮的网站。不管你是想建一个博客、论坛、CMS、电子商务网站,或是Wiki、相册管理、RSS聚合和类Digg网站。你都可以通过这些建站工具快速建立。
我们之前介绍过23个开源的CMS管理系统,现在则让我们来看一下26款开源建站程序。
国外PHP开源建 ......

PHP 中判断、循环的几种写法

下面介绍几种PHP中判断、循环的几种写法。
最普通的判断:
<?php
if( $args != NULL )
{
call_func($args);
}
?>
对于单行的执行语句,可以写成:
<?php
if( $args != NULL ) call_func($args);
?>
也可以使用引号的方式。
<?php
if( $args != NULL ):
call_func($args); ......

php表格(test)

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <style type = "text/css">
        &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号