Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[发布] discuz!7.2自定会员登录代码如何再加验证代码?

[复制链接]
1391380360 发表于 2013-3-8 20:28:58 | 显示全部楼层 |阅读模式
参照 https://discuz.dismall.com/thread-1016841-1-1.html 贴子代码,定义了会员登录,但在后台开启验证码时该代码不能显示验证码,请教高手如何调用验证码代码,使他完美。
ilei365 发表于 2013-3-8 21:22:50 | 显示全部楼层
不会的说。。。。
回复

使用道具 举报

 楼主| 1391380360 发表于 2013-3-8 21:24:49 | 显示全部楼层
分享首页自定会员登录代码:含验证码?可以登录但不知道是否正确,请高手指点
<!--{if !$discuz_uid}-->
<br>
<table border="0" cellspacing="0" cellpadding="0" width="{TABLEWIDTH}" bgcolor="{BORDERCOLOR}" align="center">
        <tr><td>
       <table border="0" cellspacing="{BORDERWIDTH}" cellpadding="{TABLESPACE}" width="100%">
        <tr class="header"><td colspan="3" align=left><form method="post" action="logging.php?action=login">
会员登录&nbsp;&nbsp;&nbsp; [<a href="register.php" style="color: #FFFFFF">立即注册</a>]&nbsp;[<a href="member.php?action=lostpasswd" style="color: #FFFFFF">忘记密码</a>]</th></tr>
<tr bgcolor="#F8F8F8"><td><input type="text" name="username" size="12" maxlength="40" tabindex="1"> &nbsp; 密码 <input type="password" name="password" size="12" tabindex="2"> &nbsp; 安全提问
<select name="questionid" tabindex="3">
<option value="0">无安全提问</option>
<option value="1">母亲的名字</option>
<option value="2">爷爷的名字</option>
<option value="3">父亲出生的城市</option>
<option value="4">您其中一位老师的名字</option>
<option value="5">您个人计算机的型号</option>
<option value="6">您最喜欢的餐馆名称</option>
<option value="7">驾驶执照的最后四位数字</option>
</select>&nbsp;Cookie 有效期?
<select name=cookietime><option  value=0>浏览器进程</option>
<option  value=3600>一小时</option>
<option  value=86400>一天</option>
<option  selected value=2592000>一个月</option>
<option  value=31536000>永久</option>
</select>
<strong><input name="seccodeverify" id="seccodeverify_logging" autocomplete="off" style="width:50px" value="验证码" class="txt" href="ajax.php?action=updateseccode" tabindex="1" type="text">
<a href="javascript:;" onclick="updateseccode();doane(event);">换一个</a>
<span id="checkseccodeverify_logging"><img src="images/common/none.gif" height="16" width="16"></span>

<script type="text/javascript" reload="1">
var profile_seccode_invalid = '验证码输入错误,请重新填写。';
var profile_secanswer_invalid = '验证问答回答错误,请重新填写。';
var lastseccode = lastsecanswer = secfocus ='';
var secanswerObj = $('secanswer');
var seccodeObj = $('seccodeverify_logging');
var secstatus = {'secanswer':0,'seccodeverify_logging':0};

if(secanswerObj) {
secanswerObj.onclick = secanswerObj.onfocus = showIdentifying;
secanswerObj.onblur = function(e) {if(!secfocus) $('secanswer_menu').style.display='none';checksecanswer();doane(e);};
}

if(seccodeObj) {
seccodeObj.onclick = seccodeObj.onfocus = showIdentifying;
seccodeObj.onblur = function(e) {if(!secfocus) $('seccodeverify_logging_menu').style.display='none';checkseccode();doane(e);};
}

function showIdentifying(e) {
var obj = BROWSER.ie ? event.srcElement : e.target;
if(!$(obj.id + '_menu')) {
obj.value = '';
ajaxmenu($(obj.id), 0, 1, 3, '12', function() {
secstatus[obj.id] = 1;
$(obj.id + '_menu').onmouseover = function() { secfocus = 1; }
$(obj.id + '_menu').onmouseout = function() { secfocus = '';$(obj.id).focus(); }
});
} else if(secstatus[obj.id] == 1) {
$(obj.id + '_menu').style.display = '';
}
obj.unselectable = 'off';
obj.focus();
doane(e);
}

function updateseccode(op) {
if(isUndefined(op)) {
ajaxget('ajax.php?action=updateseccode', seccodeObj.id + '_menu', 'ajaxwaitid', '', '', '$(seccodeObj.id + \'_menu\').style.display = \'\'');
} else {
window.document.seccodeplayer.SetVariable("isPlay", "1");
}
seccodeObj.focus();
}

function checkseccode() {
var seccodeverify = seccodeObj.value;
if(seccodeverify == lastseccode) {
return;
} else {
lastseccode = seccodeverify;
}
var cs = $('checkseccodeverify_logging');
if(!(/[0-9A-Za-z]{4}/.test(seccodeverify))) {
warning(cs, profile_seccode_invalid);
return;
}
ajaxresponse('checkseccodeverify_logging', 'action=checkseccode&seccodeverify=' + (BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(seccodeverify) : seccodeverify));
}

function checksecanswer() {
        var secanswer = secanswerObj.value;
if(secanswer == lastsecanswer) {
return;
} else {
lastsecanswer = secanswer;
}
ajaxresponse('checksecanswer', 'action=checksecanswer&secanswer=' + (BROWSER.ie && document.charset == 'utf-8' ? encodeURIComponent(secanswer) : secanswer));
}

function ajaxresponse(objname, data) {
var x = new Ajax('XML', objname);
x.get('ajax.php?inajax=1&' + data, function(s){
        var obj = $(objname);
        if(s.substr(0, 7) == 'succeed') {
                obj.style.display = '';
                obj.innerHTML = '<img src="images/default/check_right.gif" width="16" height="16" />';
obj.className = "warning";
} else {
warning(obj, s);
}
});
}

function warning(obj, msg) {
if((ton = obj.id.substr(5, obj.id.length)) != 'password2') {
$(ton).select();
}
obj.style.display = '';
obj.innerHTML = '<img src="images/default/check_error.gif" width="16" height="16" />';
obj.className = "warning";
}
</script>
</strong>
<a href="javascript:;" hidefocus="true" id="questionid_ctrl" tabindex="1">安全提问</a>
<td align="center"><input type="submit" name="loginsubmit" value="提 &nbsp; 交"></td></tr></table></td></tr></table>
<!--{/if}-->
回复

使用道具 举报

yajn 发表于 2013-3-9 23:12:22 | 显示全部楼层
代码好长啊
回复

使用道具 举报

 楼主| 1391380360 发表于 2013-3-22 21:46:10 | 显示全部楼层
回复

使用道具 举报

双IP精品合租 发表于 2013-3-22 23:25:42 | 显示全部楼层
回复

使用道具 举报

1263104 发表于 2013-4-19 21:52:36 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-10-4 09:37 , Processed in 0.096509 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表