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

PHP实例:用SESSION方法实现验证码

index.php(实现输入验证码页面)代码如下: Code代码如下: <html>
<head>
<title>check code</title>
</head>
<body>
<form name=check method=post action=check.php>
<input type=hidden name=init value=1>
验证码:<input type=text name=code maxlength=4 style="width=50px;">
<!--得到验证码图片-->
<img src=image.php>
<p>
<input type=submit value="提交">
</form>
</body>
</html>   image.php(验证码生成页面)代码如下: Code代码如下: <?php
session_start();
srand((double)microtime()*1000000); 
$authnum=rand(1000,9999);
session_register("authnum");
header("content-type:image/png");
        function creat_image( $width, $height, $authnum)
        {
                srand((double)microtime()*1000000); 
                 $im = imagecreate( $width, $height); 
                 $black = ImageColorAllocate( $im, 0,0,0); 
                 $white = ImageColorAllocate( $im, 255,255,255); 
                 $gray = ImageColorAllocate( $im, 200,200,200); 
                imagefill( $im,0,0, $gray); 
//将四位整数验证码绘入图片
                imag


相关文档:

64位动态php扩展库的编译

64位动态php扩展库的编译
 工作上需要,这个问题折腾了一阵子。不过当编译成功之后,心里还是相当的兴奋,感受到了一种成就感。也是工作中的一种乐趣。
现在将整个过程写下来,以备后续之需。
a.shared object
(1) download and install the apache
从网络中下载apache-2.0.48.tar.gz
存至/home/tmp
cd /home/ ......

PHP 5.2.11安装

#找到:
    # If the AddEncoding directives above are commented-out, then you
    # probably should define those extensions to indicate media types:
    #
    AddType application/x-compress .Z
    AddType application/x-gz ......

PHP教程:插件机制在PHP中实现方案

 这篇文章的出发点是我对插件机制的理解,及其在PHP中的实现。此方案仅是插件机制在PHP中的实现方案之一,写下来和大家分享,欢迎大家一起讨论。
插件,亦即Plug-in,是指一类特定的功能模块(通常由第三方开发者实现),它的特点是:当你需要它的时候激活它,不需要它的时候禁用/删除它;且无论是激活还是禁用都不影 ......

PHP 几个路径函数

 //
dirname()
// Returns directory name component of path
basename()
// Returns filename component of path
pathinfo()
// Returns information about a file path;
// pathinfo() returns an associative array containing information about path .
parse_url()
// Parse a URL and return its comp ......

php的session要在其他页面怎么得到

不是很赞同使用session   每一个php的页面在调用session的时候都必须先声明session。
例如:在php文件的最前面声明session;
<?php
session_start();//声明session
$_SESSION['id']=$_POST['id'];//赋值
?>
如果不这样声明的话,也免就无法获得已经定义好的sessio ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号