📄 config_login1.asp
字号:
function reg_chk()
dim username,password,password2,passwd,email,red
username=trim(request.form("username"))
password=trim(request.form("password"))
password2=trim(request.form("password2"))
passwd=trim(request.form("passwd"))
email=code_form(trim(request.form("email")))
red=""
if symbol_name(username)<>"yes" then
red=red&err_head&"您输入的 <font class=red>用户名称</font> 为空或不符合相关规则!<br>"
else
if health_name(username)<>"yes" then
red=red&err_head&"您输入的 <font class=red>用户名称</font> 含有<font class=red>本系统禁用字符</font>!<br>"
end if
if lens(username)>int(web_var(web_num,1)) then
red=red&err_head&"您输入的 <font class=red>用户名称</font> 长度<font class=red>超过系统要求</font>!<br>"
end if
end if
if symbol_ok(password)<>"yes" then
red=red&err_head&"您输入的 <font class=red>登陆密码</font> 为空或不符合相关规则!<br>"
else
if password<>password2 then
red=red&err_head&"您输入的 <font class=red>登陆密码</font> 和 <font class=red>确认密码</font> 不一致!<br>"
end if
end if
if symbol_name(passwd)<>"yes" then
red=red&err_head&"您输入的 <font class=red>密码钥匙</font> 为空或不符合相关规则!<br>"
end if
if email_ok(email)<>"yes" or len(email)>50 then
red=red&err_head&"您输入的 <font class=red>E-mail</font> 为空或不符合邮件规则!<br>"
end if
if red="" then
sql="select * from user_data where username='" & username & "'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof and rs.bof then
rs.addnew
rs("username")=username
rs("password")=jk_md5(password,"short")
rs("passwd")=jk_md5(passwd,"short")
rs("email")=email
if trim(request.form("sex"))="girl" then
rs("sex")=0
rs("face")="00"
else
rs("sex")=1
rs("face")="0"
end if
rs("face")="0"
rs("tim")=now_time
rs("power")="user"
if web_var_num(web_setup,2,1)=0 then
rs("hidden")=false
else
rs("hidden")=true
end if
rs("bbs_counter")=0
rs("counter")=0
rs("integral")=web_var(web_num,18)
rs("emoney")=web_var(web_num,19)
rs("usercp")=web_var(web_num,31)
rs("login_num")=0
rs("last_tim")=now_time
rs("popedom")="00000000000000000000000000000000000000000000000000"
rs.update
rs.close:set rs=nothing
conn.execute("update configs set new_username='"&username&"',num_reg=num_reg+1 where id=1")
if web_var_num(web_setup,2,1)=0 then
reg_chk="<font class=red><b>"&username&"</b></font>,您已成功注册成为本站用户。<br><br>您现在的状态为:<font class=red_3>未审核</font>,请等待管理员的审核。谢谢!"
else
response.cookies(web_cookies)("login_username")=username
response.cookies(web_cookies)("login_password")=jk_md5(password,"short")
response.cookies(web_cookies)("iscookies")="yes"
response.cookies(web_cookies).expires=date+365
sql="update user_data set integral=integral+0,login_num=login_num+1,last_tim='"&now_time&"' where username='"&username&"'"
conn.execute(sql)
tit=request.cookies(web_cookies)("guest_name")
if var_null(tit)<>"" then
conn.execute("delete from user_login where l_username='"&tit&"'")
end if
reg_chk="恭喜!<font class=red><b>"&username&"</b></font>,您已成功注册成为本站用户。<br><br>请尽快修改您的个人资料。<br><br><meta http-equiv='refresh' content='"&web_var(web_num,5)&"; url="&index_url&".asp'>" & _
vbcrlf & "<a href='"&index_url&".asp'>进入"&tit_fir&"</a> ┋ <a href='login.asp?action=logout'>退出本次登陆</a><br><br><br>"
end if
exit function
else
red=err_head&"您输入的 <font class=red>用户名称(<b>"&username&"</b>)</font> 已经被注册!<br>" & _
err_head&"请重新选择输入您的 <font class=red>用户名称</font> 以并继续注册!<br>"
rs.close:set rs=nothing
reg_chk=found_error(red,300):exit function
end if
rs.close:set rs=nothing
else
red=red&err_head&"请查阅有关 <a href='help.asp?action=register' class=red_3>用户注册注意事项</a> 并重新填写。"
reg_chk=found_error(red,280):exit function
end if
end function
sub login_chk()
dim username,password,red,id,power,hidden,face
if symbol_name(login_username)="yes" then
username=login_username
else
username=trim(request.form("username"))
end if
if symbol_ok(login_password)="yes" then
password=login_password
else
password=trim(request.form("password"))
password=jk_md5(password,"short")
end if
red=""
if symbol_name(username)<>"yes" then
red=red&err_head&"您输入的 <font class=red_3>用户名称</font> 为空或不符合相关规则!<br>"
end if
if symbol_ok(password)<>"yes" then
red=red&err_head&"您输入的 <font class=red_3>登陆密码</font> 为空或不符合相关规则!<br>"
end if
if red="" then
sql="select top 1 id,face,power,uip,hidden from user_data where username='"&username&"' and password='"&password&"'"
set rs=conn.execute(sql)
if rs.eof and rs.bof then
red=err_head&"您输入的 <font class=red>用户名称</font> 和 <font class=red>登陆密码</font> 有错误!<br>" & _
err_head&"请重新输入以并继续登陆本站!"
response.write found_error(red,260)
else
power=rs("power"):hidden=rs("hidden")
ip=request.servervariables("remote_addr")
if rs("uip")="" then
else
if rs("uip")<>ip then
response.write"<script>alert('你现在的IP是"&request.servervariables("remote_addr")&" 该用户帐号已经限制为只有 IP= "&rs("uip")&" 能登录,禁止同一用户同时在不同IP多次登陆!请向管理员"&web_var(web_config,3)&"联系');window.open('gbook.asp');</script>"
response.end
end if
end if
if hidden=true then
'response.cookies(web_cookies).path=web_path
response.cookies(web_cookies)("login_username")=username
response.cookies(web_cookies)("login_password")=password
sql="update user_data set integral=integral+0,last_tim='"&now_time&"' where username='"&username&"'"
conn.execute(sql)
tit=request.cookies(web_cookies)("guest_name")
if var_null(tit)<>"" then
conn.execute("delete from user_login where l_username='"&tit&"'")
end if
if trim(request.form("memery_info"))="yes" then
response.cookies(web_cookies)("iscookies")="yes"
response.cookies(web_cookies).expires=date+365
end if
'----------------------------------------------------------------------------
if trim(request.form("re_log"))="yes" then
call close_conn()
response.redirect request.servervariables("http_referer")
response.end
end if
'----------------------------------------------------------------------------
response.write "<meta http-equiv='refresh' content='"&web_var(web_num,5)&"; url="&index_url&".asp'><br><br><br>你好,<font class=red>"&username&"</font> 你现在是 <font class=red>"&format_power(power,1)&"</font> 登陆模式<br><br>" & _
vbcrlf & "<a href='"&index_url&".asp'>进入"&tit_fir&"</a> ┋ <a href='login.asp?action=logout'>退出本次登陆</a><br><br><br>"
else
response.write "<font class=red>您的用户帐号还未审核!</font><br><br>请与管理员联系。"
end if
end if
rs.close
else
red=red&err_head&"请查阅有关 <a href='help.asp?action=register' class=red_3>用户注册注意事项</a> 并重新填写。"
response.write found_error(red,280)
end if
end sub
sub login_main()
%>
<script language=javascript src='style/login.js'></script>
<table border=0>
<form name=login_frm method=post action='login.asp?action=login_chk' onsubmit="return login_true()">
<tr><td align=center height=30>用户名称: <input type=text name=username size=15 maxlength=20 tabindex=1> </td></tr>
<tr><td align=center>登陆密码: <input type=password name=password size=15 maxlength=20 tabindex=2> </td></tr>
<tr><td align=center height=30 align=center><input type=radio name=memery_info value='no' class=bg_1> 登陆一次
<input type=radio name=memery_info value='yes' checked class=bg_1> 永久登陆</td></tr>
<tr><td align=center>
<input type=button value='注 册' onClick="document.location='login.asp?action=register'">
<input type=button value='忘记密码' onClick="document.location='login.asp?action=nopass'">
<input type=submit value='登 陆' tabindex=3>
</td></tr>
</table>
<%
end sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -