我做了个家教管理系统,是软件作业。但登陆和搜索有问题。我不知道怎么办?请高手看一下啊!帮忙修改一下!!拜谢!!!
这是个登陆页
<%if (session("student_name")="" and session("teacher_name")="") then%>
<form method="post" action="denglu1.asp">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> 用户名:
<input type="text" name="user" size="14"></td>
</tr>
<tr>
<td height="21"> 密 码:
<input type="password" name="password" size="14"></td>
</tr>
<tr>
<td height="24">
<div align="center">
<input name="lb" type="radio" value="teacher" checked>
教员
<input type="radio" name="lb" value="student">
学员 </div></td>
</tr>
<tr>
<td valign="bottom"> <div align="center">
<input type="submit" name="Submit" value="登录" class="anniu">
<input a href="#" onclick="window.open('zhuce.asp')" type="button" name="Submit1" value="注册" class="anniu"></form>
</div></td>
</tr>
</table>
<%else%>
<%if session("student_name")="" then%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">
<li>用户名:<%=session("teacher_name")%>
<li>类别:<strong>教员</strong>
<li>会员币:<font color="#FF0000"><%=session("zj")%></font>个
<li>状态:<font color="#FF0000"><%if session("zt")=0 then%>未通过认证<% else %>通过认证<% End If %>
</font>
<li><a href="zcls_mod.asp">资料修改</a>
<li><a href="teachermail.asp">预约信箱</a>
<li><a href="xiaofei.asp">消费管理</a>
<li><a href="logout.asp">退出登陆</a></td>
</tr>
</table>
<%end if%>
<%if session("teacher_name")="" then%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2">
<li>用户名:<%=session("student_name")%>
<li>类型:<strong>学员</strong>
<li>会员币:<font color="#FF0000"><%=session("student_zj")%></font>个
<li><a href="zcxs_mod.asp">资料修改</a>
<li><a href="studentmail.asp">预约信箱</a>
<li><a href="logout.asp">退出登陆</a></td>
</tr>
</table>
<%end if%>
<%end if%>
登陆页二<!--#include file="xuexi.asp"-->
<!--#include file="md5.asp"-->
<%
user=request("user")
password=md5(trim(request("password")))
lb=request("lb")
if lb="teacher" then
set rs=server.createobject("adodb.recordset")
sql="select * from teacher where teacher_name='"&user&"' and teacher_password='"&password&"'"
rs.open sql,conn,3,3
if rs.bof or rs.eof then
response.write"<SCRIPT language=JavaScript>alert('错误的用户名、密码或您不是此类型用户,请重新输入!');"
response.write"javascript:history.go(-1)</SCRIPT>"
else
session("teacher_name")=trim(rs("teacher_name"))
session("teacher_id")=trim(rs("teacher_id"))
session("zj")=trim(rs("zj"))
session("zt")=trim(rs("zt"))
response.redirect("index.asp")
end if
else
set rs=server.createobject("adodb.recordset")
sql="select * from student where student_name='"&user&"' and student_password='"&password&"'"
rs.open sql,conn,3,3
if rs.eof then
response.write"<SCRIPT language=JavaScript>alert('错误的用户名、密码或您不是此类型用户,请重新输入!');"
response.write"javascript:history.go(-1)</SCRIPT>"
else
session("student_name")=trim(rs("student_name"))
session("student_id")=trim(rs("student_id"))
session("student_zj")=trim(rs("student_zj"))
response.redirect("index.asp")
end if
end if %>