php 验证码生成程序[可自动判断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();
分析师预测SHIB目标价格为0.000081美元,技术分析显示柴犬币可能迎来600%暴涨
MemeX推出"Proof of Sh*t"验证机制,以700万美元奖励门槛对抗AI作恶
一位花旗高管的重要警告与巴克莱银行的禁令揭示了加密货币领域的深刻分歧
分析师预测:以太坊价格将在下一个山寨币季达到10,000美元
mexc抹茶交易所app最新版下载 mexc抹茶交易所v6.23.0官方版安装包
乐观币价格预测显示牛市格局,市场瞄准2美元目标 - 勇敢新币