注册 | 登录 | 设为首页 | 加入收藏
您当前的位置:飞翔学院-IT中国 → 编程开发Asp → 文章内容

请教一个问题!

作者:IT 来源:不详 发布时间:2007-9-1 23:34:44
(问题就是从第一个登陆界面无法成功登陆,显示页

面三!)



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>

http://www.itcnw.com/
  • 打印文档
  • 推荐好友
  • 返回顶部
  • 增大字体
  • 减少字体

热点文章

关于本站 | 工作机会 | 合作网站 | 广告服务 | 市场合作| 联系我们 | 抽奖活动
版权所有: 武汉威俊科技有限公司 Copyright 2005-2007 www.ITCNW.COM All rights reserved