相思资源网 Design By www.200059.com

本文实例为大家分享了php点击可刷新验证码的具体代码,供大家参考,具体内容如下

验证码类文件 CreateImg.class.php

<"Content-type: image/png"); 
} 
 
private function createCode() 
{ 
 $this->checkcode = strtoupper(substr(md5(rand()),0,$this->codenum)); 
} 
 
private function createImage() 
{ 
 $this->checkimage = @imagecreate($this->width,$this->height); 
 $back = imagecolorallocate($this->checkimage,255,255,255); 
 $border = imagecolorallocate($this->checkimage,0,0,0); 
 imagefilledrectangle($this->checkimage,0,0,$this->width - 1,$this->height - 1,$back); // 白色底 
 imagerectangle($this->checkimage,0,0,$this->width - 1,$this->height - 1,$border); // 黑色边框 
} 
 
private function setDisturbColor() 
{ 
 for ($i=0;$i<=200;$i++) 
 { 
 $this->disturbColor = imagecolorallocate($this->checkimage, rand(0,255), rand(0,255), rand(0,255)); 
 imagesetpixel($this->checkimage,rand(2,128),rand(2,38),$this->disturbColor); 
 } 
} 
 
private function writeCheckCodeToImage() 
{ 
 for ($i=0;$i<=$this->codenum;$i++) 
 { 
 $bg_color = imagecolorallocate ($this->checkimage, rand(0,255), rand(0,128), rand(0,255)); 
 $x = floor($this->width/$this->codenum)*$i; 
 $y = rand(0,$this->height-15); 
 imagechar ($this->checkimage, rand(5,8), $x, $y, $this->checkcode[$i], $bg_color); 
 } 
} 
function __destruct() 
{ 
 unset($this->width,$this->height,$this->codenum); 
} 
} 
"htmlcode">
<"htmlcode">
"content-type" content="text/html;charset=utf-8"> 
<script language="javascript"> 
function newgdcode(obj,url) { 
obj.src = url+ '"imgcode.php" alt="看不清楚,换一张" align="absmiddle" style="cursor: pointer;" onclick="javascript:newgdcode(this,this.src);" /> 
<form method="POST" name="form1" action="image.php"> 
<input type="text" name="test"> 
<br /> 
<input type="submit" name="submit" value="提交"> 
</form> 
</body> 
</head> 
</html> 

以上就是为大家介绍的php点击验证码即可刷新的全部代码,希望对大家的学习有所帮助。

标签:
php验证码点击刷新,thinkphp验证码刷新,php验证码刷新,点击刷新验证码,jquery点击刷新验证码,js点击刷新验证码

相思资源网 Design By www.200059.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
相思资源网 Design By www.200059.com

评论“php实现点击可刷新验证码”

暂无php实现点击可刷新验证码的评论...