请教一个问题!
发表于:2007-06-30来源:作者:点击数:
标签:
(问题就是从第一个登陆界面无法成功登陆,显示页 面三!) 1.asp html head title请您输入您的用户名及密码!/title /head body bgcolor=#ffff00 text=#FFFFFF form name=form method=post action=2.htm tr td background=../bj/74.gif colspan=2 height=25
(问题就是从第一个登陆界面无法成功登陆,显示页
面三!)
1.asp
<html>
<head>
<title>请您输入您的用户名及密码!</title>
</head>
<body bgcolor="#ffff00" text="#FFFFFF">
<form name=form method=post
action=2.htm>
<tr>
<td
background="../bj/74.gif" colspan="2"
height="25">
<div align="center"
class="13white">会员登录</div>
</td>
</tr>
<tr>
<td width="41%" height="30">
会员ID号: </td>
<td width="59%" height="30">
<input type=text
name=username2 size=15>
</td>
</tr>
<tr>
<td width="41%"> 密 码
:</td>
<td width="59%">
<input type=password
name=password2 size=15>
</td>
</tr>
<tr>
<td colspan="2" height="37">
<div align="center">
<input type=submit
name=Submit2 value=登录>
<input type=reset
name=reset2 value=重写>
</div>
</td>
</tr>
</body>
</html>
2.asp
<%@language=
vbscript%>
<%
Function checkpassword(name,password)
conn="driver={microsoft a
clearcase/" target="_blank" >ccess driver
(*.mdb)};dbq="&server.mappath("moneyhy.mdb")
sql="select * from moneyhy where
idname=‘’"&name&"‘’ and pwd=‘’"&password&"‘’"
Set rs=server.createobject
("adodb.recordset")
rs.open sql,conn
If rs.eof then
checkpassword=false
Else
checkpassword=true
End If
End Function
%>
<%
If isempty(session("passed")) then
session("passed")=false
session("vipusername")=request.form("username"
)
session("vippassword")=request.form("password"
)
Dim n,p
n=session("vipusername")
p=session("vippassword")
If n="" or p="" then
response.write "用户名或密码不能为空,请填完
整!<a href=history.back 1>返回</a>"
elseif not checkpassword(n,p) then
response.write "用户名或密码不正确,请重新输
入!<a href=history.back 1>返回</a>"
else
session("passed")=true
End If
if session("passed")=true then
response.redirect"3.htm"
End If
%>
3.asp
<html>
<head>
<title>登陆成功</title>
</head>
<body bgcolor="#ef1f00" text="#FFFFFF">
欢迎光临!你一成功登陆!
祝你中秋节快乐,一定要记得吃月饼看月亮。。。
</body>
</html>
原文转自:http://www.ltesting.net