Session_start(); $_SESSION["check"] = $check;
$y1=rand(0,30); $y2=rand(0,30); $y3=rand(0,30); $y4=rand(0,30); imageline($im,0,$y1,70, $y3,000); imageline($im,0,$y2,70, $y4,000);
$strx=rand(3,15); $stry=rand(2,15); imagestring($img,5,$strx,$stry,substr($check,0,1),ImageColorAllocate($img,34,87,100)); $strx+=rand(15,20); $stry=rand(2,15); imagestring($img,5,$strx,$stry,substr($check,1,1),ImageColorAllocate($img,781,117,78)); $strx+=rand(15,20); $stry=rand(2,15); imagestring($img,5,$strx,$stry,substr($check,2,1),ImageColorAllocate($img,160,40,40)); $strx+=rand(15,20); $stry=rand(2,15); imagestring($img,5,$strx,$stry,substr($check,3,1),ImageColorAllocate($img,25,55,10));
Header("Content-type: image/PNG");
ImagePNG($img);
<?php $check=rand(1000,9999);
Session_start();
$_SESSION["check"] = $check;
$img = imagecreate(80,30);
imagefill($img,0,0,ImageColorAllocate($img,255,255,255));
$y1=rand(0,30);
$y2=rand(0,30);
$y3=rand(0,30);
$y4=rand(0,30);
imageline($img,0,$y1,70, $y3,ImageColorAllocate($img,55,255,25));
imageline($img,0,$y2,70, $y4,ImageColorAllocate($img,55,55,255));
$strx=rand(3,15);
$stry=rand(2,15);
imagestring($img,5,$strx,$stry,substr($check,0,1),ImageColorAllocate($img,34,87,100));
$strx+=rand(15,20);
$stry=rand(2,15);
imagestring($img,5,$strx,$stry,substr($check,1,1),ImageColorAllocate($img,781,117,78));
$strx+=rand(15,20);
$stry=rand(2,15);
imagestring($img,5,$strx,$stry,substr($check,2,1),ImageColorAllocate($img,160,40,40));
$strx+=rand(15,20);
$stry=rand(2,15);
imagestring($img,5,$strx,$stry,substr($check,3,1),ImageColorAllocate($img,25,55,10));
Header("Content-type: image/PNG");
ImagePNG($img);
<!DOCTYPE html> <html> <body> <form action="action.php" method="post"> <input type="text" name="cikle" placeholder="验证码"> <br> <img id="cikle" style="-webkit-user-select: none" src="img.php"><input type="submit" value="Submit"> </form> </body> </html>
<?php
Session_start();
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if($_SESSION["check"]!=intval($_POST["cikle"])){
echo "不正确";
}else{
echo "正确";
}
}
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有