PHP ???? ??? ????
????? ?? PHP ??? ???? ?????. ??? ??? ??? ???? ?? ????? ?????. ?? ??? ??? ???? ????? ??? ????
yanzhengma.php ?? ? ???? ????? ?????
<?php session_start(); Header("Content-type:image/PNG"); $im = imagecreate(60, 25); $back = imagecolorallocate($im, 245, 245, 245); imagefill($im, 0, 0, $back); $vcodes = ""; for($i = 0; $i < 4; $i++){ $font = imagecolorallocate($im, rand(100, 255), rand(0, 100), rand(100, 255)); $authnum = rand(0, 9); $vcodes .= $authnum; imagestring($im, 5, 9 + $i * 10, 5, $authnum, $font); } $_SESSION['VCODE'] = $vcodes; for($i=0;$i<200;$i++) { $randcolor = imagecolorallocate($im, rand(0, 255), rand(0, 255), rand(0, 255)); imagesetpixel($im, rand()%60, rand()%25, $randcolor); // } imagepng($im); imagedestroy($im); ?>
??: ?? ?? ????? ????? ???? ??? ??? ?????. ???? ?? ??? ???? ??? ??????
?? ?? ????? ?? ????? ??? ?? ??? ????? <img> ??? ??? ? ????. ??? ??? ????
<p>驗 證 碼:<input type="text" name="yzm" id="yzm"> <img src="yanzhengma.php">src
: ?? ????? ??? ????. ????? ??? ?? ????? ????. ?? ??? ???? ???
? ???? ???? ?? ??? ??? ? ????. ??? ????? ???? ???. ?? ???? ?? ??? ?? ?????. ?? ????? JS? ?????. <img> ?? ?? ?? ??? ?????<img src="yanzhengma.php" onClick="this.src='yanzhengma.php?nocache='+Math.random()" style="cursor:hand">
?? ??? ??? ?? ??? ??? ?????
??? ??? ??? ????.
<!doctype html> <html> <head> <meta charset="utf-8"> <title>PHP中文網(wǎng)</title> <style type="text/css"> body{background-color: rgba(223, 255, 231, 0.28) } .container{ border-radius: 25px; box-shadow: 0 0 20px #222; width: 380px; height: 400px; margin: 0 auto; margin-top: 200px; background-color: rgba(152, 242, 242, 0.23); } .right { position: relative; left: 40px; top: 20px; } input{ width: 180px; height: 25px; } button{ background-color: rgba(230, 228, 236, 0.93); border: none; color: #110c0f; padding: 10px 70px; text-align: center; display: inline-block; font-size: 16px; cursor: pointer; margin-top: 30px; margin-left: 50px; } </style> </head> <body> <form action="" method="post"> <div class="container"> <div class="right"> <h2>用戶注冊</h2> <p>用 戶 名:<input type="text" name="name" id="name"></p> <p>密 碼: <input type="password" name="pwd" id="pwd"></p> <p>確認(rèn)密碼: <input type="password" name="pwdconfirm" id="pwdconfirm"></p> <p>驗 證 碼:<input type="text" name="yzm" id="yzm"> <img src="yanzhengma.php" onClick="this.src='yanzhengma.php?nocache='+Math.random()" style="cursor:hand"></p> <p><button type="submit" value="注冊" >立即注冊</button></p> </div> </div> </form> </body> </html>
?? CSS ???? ??? ? ?? ?? ??? ??? ? ???? ?? ??? ???? ???? ????. ?? ?? ??? ??? ????? ??? ?????. ???? ??? ???? ??? ? ????. ? ? ??? ????? ?? ???? ???????. ????? js? ???? ???. ?? ????? JS? ???? ? ??? ???? ??? ????????