您的位置:首页 > 其它

如何使用织梦自带的验证码

2014-07-16 00:00 405 查看
摘要: 使用织梦自带的验证码来进行登录或者注册的验证,防止恶意注册

在织梦include/vdimgck.php这个文件就是生成验证码的文件了

示例:

<input type="text" class="entry ent-2 w-156 " style=" width:80px; text-transform: uppercase;" id="vdcode" name="vdcode" class="code"/>
<img id="vdimgck" align="absmiddle" onclick="this.src=this.src+'?'" style="cursor: pointer;" alt="看不清?点击更换" src="/include/vdimgck.php"/> 看不清? <a href="javascript:void(0)" onclick="changeAuthCode();">点击更换</a>
<script type="text/javascript">
$ = jQuery;
function changeAuthCode() {
var num = new Date().getTime();
var rand = Math.round(Math.random() * 10000);
num = num + rand;
$('#ver_code').css('visibility','visible');
if ($("#vdimgck")[0]) {
$("#vdimgck")[0].src = "../include/vdimgck.php?tag=" + num;
}
return false;
}
</script>


如何获取验证码的cookie

使用函数$svali = GetCkVdValue();

但是使用该函数时要引用common.inc.php这个函数库
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  验证码 织梦