说明:验证码是为了有效防范机器群发而设,能简单有效的防范大部分群发工具(即使现在的图片识别率比较高,也能防范互联网的大量新手试验)
生成验证码代码地址:
<img src="api.php?c=vcode" onclick="update_vcode(this)" style="cursor:pointer" />
JS函数编写
function update_vcode(obj) { var url = "api.php?c=vcode&_noCache="+Math.random(); $(obj).attr("src",url); }
验证码存放的表单字段是:_chkcode
HTML代码如下 :
<input type="text" name="_chkcode" id="_chkcode" />