设为首页收藏本站

新微赢技术网

 找回密码
 注册
搜索
热搜: 回贴
查看: 42|回复: 1
打印 上一主题 下一主题

[求助]急急急~~验证登陆问题

[复制链接]
跳转到指定楼层
1#
发表于 2010-1-19 01:31:51 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
输入用户名和密码后仍然是“无法显示”小弟刚接触asp~~确实不知道问题出在哪里,请各位大哥指点了~~(数据库名:student;字段1:user;字段2:password)

<%
function checkpassword(user,passord)
set conn=server.createobject("adodb.connection")
param="driver={microsoft access driver (*.mdb)}"
conn.open param &amp; ";dbq=" &amp; server.mappath("student.mdb")
sql="select*from student where 用户名=’" &amp; user &amp; "’ and 密码=’" &amp; password &amp; "’"
set rs=conn.execute(sql)
if rs.eof then
checkpassword=false
else
checkpassword=true
end if
end function
%>
<%
if isEmpty(session("password")) then session("password")=false
用户名=request("user")
密码=request("password")
if user="" or password="" then response.write"请输入您的登录名及密码。"
elseif not checkstudent(user,password) then response.write"用户名或密码错误! 请检查你的用户名及密码然后再试一次!"
else session("passed")=true
end if
if not session("passed") then%>
<body>
<form runat=server method="POST">
<table width="360" border="0" align="center" cellpadding="8" bgcolor="#588FC7">
<tr>
<td><h3 align="center" class="style1">登入页面</h3>
<table width="260" align="center" class="9ps">
<tr>
<td nowrap><div align="right" class="style2"><strong>用户名:</strong></div></td>
<td colspan="2"><input name="user" type="text" id="UserName" runat=server/ size="20">
<asp:RequiredFieldValidator ControlToValidate="UserName" Display="Static" ErrorMessage="*" runat=server/>
<span class="style2">*</span></td>
</tr>
<tr>
<td nowrap><div align="right" class="style2"><strong>密码:</strong></div></td>
<td colspan="2"><input name="password" type=password id="Passwords" runat=server/>
<asp:RequiredFieldValidator ControlToValidate="Passwords" Display="Static" ErrorMessage="*" runat=server/> <span class="style2">*</span></td>
</tr>
<tr>
<td colspan="3" align="center"><span class="style3">
<asp:CheckBox ID=PersistCookie runat="server" /> </span> <br> <span class="style1">(此系统仅供毕业班同学使用)</span> </td>
</tr>
</table>
<div align="center">
<asp:Button Text="进入" OnClick="Login_Click" runat=server/>
<br>
<asp:Label ID="Msg" ForeColor="red" Font-Name="Verdana" Font-Size="10" runat=server />
<a href="http://127.0.0.1/web/student.mdb"> <input type=submit name=submit value="登录">
</a>
</div></td>
</tr>
</table>
<h3 align="center">&nbsp;</h3>
</form>
</body>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

申请友链|小黑屋|最新主题|手机版|新微赢技术网 ( 苏ICP备08020429号 )  

GMT+8, 2024-11-20 07:44 , Processed in 0.135250 second(s), 9 queries , Gzip On, Memcache On.

Powered by xuexi

© 2001-2013 HaiAn.Com.Cn Inc. 寰耽

快速回复 返回顶部 返回列表