易截截图软件、单文件、免安装、纯绿色、仅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


相关文档:

java,php,mysql时间处理

java中时间戳和时间字符串之间的转换
获取当前的unix时间戳
new Date().getTime()
System.currentTimeMillis()
返回的是毫秒数,要转换long t = System.currentTimeMillis()/1000;
获取当前年月日以及时分秒
Calendar c = Calendar.getInstance();
c.get(Calendar.YEAR))  c.get(Calendar.YEAR))  c.get(C ......

PHP 发送邮件

 
PHP 发送邮件
作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 修改:2007-06-17 浏览:14208 ::  :: 
 PHP Sessions
PHP allows you to send e-mails directly from a script.
PHP允许你通过脚本直接发送e-mail。
The PHP mail() Function
PHP mail()函数
The PHP m ......

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 ......

PHP会话(Session)使用入门

对比起 Cookie,Session 是存储在服务器端的会话,相对安全,并且不像 Cookie 那样有存储长度限制,本文简单介绍 Session 的使用。
由于 Session 是以文本文件形式存储在服务器端的,所以不怕客户端修改 Session 内容。实际上在服务器端的 Session 文件,PHP 自动修改 Session 文件的权限,只保留了系统读和写权限,而 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号