📄 login2.asp
字号:
<!--#include file="db.inc" -->
<%
name=request.form("username")
'密码转换函数
Function encryptpwd(passwd)
dim leghth, i, newpasswd
dim temp
dim head, tail
passwd=left(passwd,10)
length=len(passwd)
newpasswd=""
for i=1 to length
temp=mid(passwd,i,1)
temp=asc(temp)
head=temp mod 16
tail=temp\16
temp=(head*16)+tail
if cint(temp)<100 and cint(temp)>10 then
temp="0"&temp
else
if cint(temp)<10 then
temp="00"&temp
end if
end if
newpasswd=newpasswd&temp
next
encryptpwd=newpasswd
end function
sub alert()
MsgBox "你的用户名或密码输入有误!", 64, "Oh no!"
end sub
password=encryptpwd(request.form("psw"))
sql= "select * from user where username='"&name&"' and psw='"&password&"'"
set rs=conn.execute(sql)
if rs.eof or rs.bof then%>
<title>登录失败</title>
<BODY vLink=#333333 aLink=#333333 link=#333333 bgColor=#ffffff leftMargin=0
topMargin=0><LINK href="forum.css" type=text/css
rel=stylesheet>
<%dim name,password
name=session("loginname")
password=session("password")%>
<TABLE cellSpacing=0 cellPadding=1 width="95%" align=center bgColor=#0099cc border=0>
<TBODY>
<TR>
<TD>
<TABLE style="COLOR: #000000" cellSpacing=0 cellPadding=4 width="100%"
border=0>
<TBODY>
<TR bgColor=#99ccff>
<td width="27%" height="2" bgcolor="#99ccff"><font color="#FF0000">>></font>欢迎您!<b>
<%if session("loginname")="" then %>
请先登录!
<%end if%>
<%=session("loginname")%></b></td>
<td height="2" width="62%"><img src="images/reg.gif" width="16" height="16" align="absmiddle"><a href="reg.asp">用户注册</a>|<img src="images/pmlogin.gif" width="16" height="16" align="absmiddle"><a href="login.asp">用户登录</a>|<img src="images/update.gif" width="16" height="16"><a href="usermodify.asp">修改资料</a>|<img src="images/message.gif" width="21" height="14">现在时间:<%=now()%></td>
<td width="11%" height="2"><img src="images/home.gif" width="14" height="14" align="absmiddle">返回首页</td>
</TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<!--#include file="login2body.asp"-->
<table width="75%" border="0" align="center" bgcolor="#0099cc" cellpadding="1" cellspacing="1">
<tr>
<td bgcolor="#99ccff" height="20">
<div align="center"><b>登录失败</b></div>
</td>
</tr>
<tr>
<td bgcolor="#e8f4ff" height="19">
<li>可能是你的用户名或密码输入有误!请点击登录重试!(<a href="login.asp"><font color="#FF0000">登录</font></a>)</li>
</td>
</tr>
<tr>
<td bgcolor="#99ccff" height="20"> </td>
</tr>
</table>
<!--#include file="footer.asp"-->
<%
else
Session("loginname")=name
Session("password")=request.form("psw")
response.redirect "index.asp"
end if
%>
</body>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -