分享首页自定会员登录代码:含验证码?可以登录但不知道是否正确,请高手指点
<!--{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">
会员登录 [<a href="register.php" style="color: #FFFFFF">立即注册</a>] [<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"> 密码 <input type="password" name="password" size="12" tabindex="2"> 安全提问
<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> 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="提 交"></td></tr></table></td></tr></table>
<!--{/if}--> |