博威---云架构决胜云计算

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2450|回复: 2

简单的彩色彩色验证码

[复制链接]
发表于 2007-10-1 19:36:45 | 显示全部楼层 |阅读模式
<?php
session_start();
$im=imagecreate(58,24);
$black=imagecolorallocate($im,255,255,255);
$white=imagecolorallocate($im,0,0,0);
$grey=imagecolorallocate($im,126,0,125);
imagefill($im,0,0,$grey);
$num=rand(10000,99999);
imagestring($im,6,10,8,$num,$black);
for($i=0;$i<200;$i++)   //加入干扰象素
{
    $randcolor = ImageColorallocate($im,rand(0,255),rand(0,255),rand(0,255));
    imagesetpixel($im, rand()%70 , rand()%30 , $randcolor);
}
header("content-type:image/png");
imagepng($im);
imagedestroy($im);
session_register('num');
?>
发表于 2007-10-11 08:24:19 | 显示全部楼层
发表于 2009-2-13 14:04:27 | 显示全部楼层

好帖子就是要顶!!!!!


好帖子就是要顶~~~~~~~~~~~

连连看黄金矿工拳皇祖玛双人小游戏
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|boway Inc. ( 冀ICP备10011147号 )

GMT+8, 2024-6-17 07:46 , Processed in 0.083019 second(s), 17 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表