欢迎光临
我们一直在努力

请教一个问题!-ASP教程,ASP基础

建站超值云服务器,限时71元/月

(问题就是从第一个登陆界面无法成功登陆,显示页

面三!)

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 access 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>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 请教一个问题!-ASP教程,ASP基础
分享到: 更多 (0)