<?php//小猪会气功session_start();session_register('code');$width = "70";//图片宽$height = "25";//图片高$len = "4";//生成几位验证码$bgcolor = "#ffffff";//背景色$noise = true;//生成杂点$noisenum = 200;//杂点数量$border = false;//边框$bordercolor = "#000000";$image = imageCreate($width, $height);$back = getcolor($bgcolor);imageFilledRectangle($image, 0, 0, $width, $height, $back);$size = $width/$len;if($size>$height) $size=$height;$left = ($width-$len*($size+$size/10))/$size;for ($i=0; $i<$len; $i++){ $randtext = rand(0, 9); &...
PHP图片验证码原代码,需支持gd2.dll扩展,需修改PHP.ini后重启IIS or ap 调用方法<img src="this.php">
<?PHP session_start(); session_register('SafeCode'); $type = 'gif'; $width= 40; $height= 16; header("Content-type: image/".$type); srand((double)microtime()*1000000); $randval = randStr(4,""); if($type!='gif' && function_exists('imagecreatetruecolor')){ $im = @imagecreatetruecolor($width,$height); }else{ $im = @imagecreate($width,$height); } $r = Array(225,211,255,223); $g = Array(225,236,237,215); $b = Array(225,236,166,125); $key = rand(0,3); $backColor = I...