日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程语言 > php >内容正文

php

php-验证码

發布時間:2023/12/13 php 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 php-验证码 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

<
html><body> <h2>用戶注冊:</h2> <br> <form action="a.php" method="post">&nbsp;&nbsp;號:<input type="text" name="zh" id=""> <br>&nbsp;&nbsp;碼:<input type="password" name="mm" id=""> <br> 驗證碼:<input type="text"name="yzm"> <br> <img src="yzm.php"> <br> <input type="submit" value="提交"> <input type="reset" value="重置"> </form></body></html>

//html頁面

?

?

?

<?php$a = imagecreatetruecolor(100,20);//畫布$black = imagecolorallocate($a,0,0,0);$white = imagecolorallocate($a,255,255,255);$gray = imagecolorallocate($a,200,200,200);$red = imagecolorallocate($a,255,0,0);//顏料 imagefill($a,0,0,$red);//填充for($i=0;$i<20;$i++){$x = mt_rand(0,100);$y = mt_rand(0,20); imagesetpixel($a,$x,$y,$white);imagesetpixel($a,$x,$y+1,$white);imagesetpixel($a,$x,$y+2,$white);imagesetpixel($a,$x,$y-1,$white);imagesetpixel($a,$x,$y-2,$white);imagesetpixel($a,$x+1,$y,$white);imagesetpixel($a,$x+2,$y,$white);imagesetpixel($a,$x-1,$y,$white);imagesetpixel($a,$x-2,$y,$white);}$z1 = range('a','z');$z2 = range('A','Z');$z3 = mt_rand(0,9);$z4 = mt_rand(0,9);imagestring($a,26,25,2,$z1[mt_rand(0,24)],$white);imagestring($a,26,33,2,$z2[mt_rand(0,24)],$white);imagestring($a,26,41,2,$z3,$white);imagestring($a,26,49,2,$z4,$white);header("content-type:image/jpeg");imagepng($a);//保存 imagejpeg($a);//輸出?>

//php畫庫

?

轉載于:https://www.cnblogs.com/yjh1604600160/p/p-14.html

總結

以上是生活随笔為你收集整理的php-验证码的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。