最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php 验证码生成程序[可自动判断php gd库]
时间:2022-07-02 10:15:10 编辑:袖梨 来源:一聚教程网
生成程序[可自动判断php gd库]
function ShowKey()
{
$key=strtolower(domake_password(4));
$set=esetcookie("checkkey",$key);
//是否支持gd库
if (function_exists("imagejpeg")) {
header ("Content-type: image/jpeg");
$img=imagecreate(69,20);
$black=imagecolorallocate($img,255,255,255);
$gray=imagecolorallocate($img,102,102,102);
imagefill($img,0,0,$gray);
imagestring($img,3,14,3,$key,$black);
imagejpeg($img);
imagedestroy($img);
}
elseif (function_exists("imagegif")) {
header ("Content-type: image/gif");
$img=imagecreate(69,20);
$black=imagecolorallocate($img,255,255,255);
$gray=imagecolorallocate($img,102,102,102);
imagefill($img,0,0,$gray);
imagestring($img,3,14,3,$key,$black);
imagegif($img);
imagedestroy($img);
}
elseif (function_exists("imagepng")) {
header ("Content-type: image/png");
$img=imagecreate(69,20);
$black=imagecolorallocate($img,255,255,255);
$gray=imagecolorallocate($img,102,102,102);
imagefill($img,0,0,$gray);
imagestring($img,3,14,3,$key,$black);
imagepng($img);
imagedestroy($img);
}
elseif (function_exists("imagewbmp")) {
header ("Content-type: image/vnd.wap.wbmp");
$img=imagecreate(69,20);
$black=imagecolorallocate($img,255,255,255);
$gray=imagecolorallocate($img,102,102,102);
imagefill($img,0,0,$gray);
imagestring($img,3,14,3,$key,$black);
imagewbmp($img);
imagedestroy($img);
}
else {
$set=esetcookie("checkkey","ebak");
@include("class/functions.php");
echo ReadFiletext("images/ebak.jpg");
}
}
ShowKey();
相关文章
- 致命公司铲子可攻击怪物类型汇总 12-05
- 星球重启20级头盔制作方法详解 12-05
- 星球重启分解废品任务完成方法 12-05
- 星球重启偶像任务攻略 偶像任务过法 12-05
- 星球重启9个酸液腺体获取攻略 12-05
- 星球重启采集工具制作方法 采集工具怎么做 12-05