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

在织梦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这个函数库

你可能感兴趣的:(验证码,织梦)