我做了个家教管理系统,是软件作业。但登陆和搜索有问题。我不知道怎么办?请高手看一下啊!帮忙修改一下!!拜谢!!!
这个是搜索页
<%
dim count
set rs=server.createobject("adodb.recordset")
sql = "select * from bigxm order by bigxm_id asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("bigxm_name"))%>","<%= trim(rs("smallxm_id"))%>","<%= trim(rs("bigxm_id"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.bigxm_id.length = 1;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.bigxm_id.options[document.myform.bigxm_id.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<form method="post" name="myform" action="ru_query.asp">
<div align="left">
<table width="376" border="0" align="center">
<tr valign="middle" bgcolor="#C1E0FF">
<td width="68"><div align="center">学 科:</div></td>
<td width="145"><div align="left">
<select name="bigxm_id" onChange="changelocation(document.myform.smallxm_id.options[document.myform.smallxm_id.selectedIndex].value)" size="1">
<option selected value="">未指定条件</option>
<%
sql = "select * from bigxm"
rs.open sql,conn,1,1
do while not rs.eof
%>
<option value="<%=trim(rs("bigxm_id"))%>"><%=trim(rs("bigxm_name"))%> </option>
<%
rs.movenext
loop
rs.close
%>
</select>
</div></td>
<td width="66"><div align="center">高 校:</div></td>
<td width="79"><div align="left">
<select name="action" size="1" class="smallinput" >
<option value="nmt" selected>不限</option>
<option value="xy1">西北工业大学</option>
<option value="xy2">西安交通大学</option>
<option value="xy3">西北大学</option>
<option value="xy4">西安电子科技大学</option>
<option value="xy5">陕西师范大学</option>
<option value="xy6">西安外国语学院</option>
<option value="xy7">西安理工大学</option>
<option value="xy8">长安大学</option>
<option value="xy9">西安建筑科技大学</option>
<option value="xy10">西安石油大学</option>
<option value="xy11">西安科技大学</option>
<option value="xy12">西北政法大学</option>
<option value="xy13">西安工程科技学院</option>
<option value="xy14">西安工业学院</option>
<option value="xy15">西安培华大学</option>
<option value="xy16">西安财经学院</option>
<option value="xy17">西安美术学院</option>
<option value="xy18">其它</option>
</select>
</div></td>
</tr>
<tr valign="middle" bgcolor="#84C3FF">
<td><div align="center">教学区域:</div></td>
<td><div align="left">
<select name="select" size="1" class="smallinput" >
<option value="nomt">不限</option>
<option value="bl" selected>碑林区</option>
<option value="lh">莲湖区</option>
<option value="xc">新城区</option>
<option value="wy">未央区</option>
<option value="yt">雁塔区</option>
<option value="bq">灞桥区</option>
<option value="ca">长安区</option>
</select>
</div></td>
<td><div align="center">搜索分类:</div></td>
<td><div align="left">
<select name="action" size="1" class="smallinput" >
<option value="title" selected>教师姓名</option>
<option value="content">个人简介</option>
<option value="writer">收费标准</option></select>
</div></td>
</tr>
<tr valign="middle" bgcolor="#C1E0FF">
<td><div align="center">性 别:</div></td>
<td><div align="left">
<select name="action" size="1" class="smallinput" >
<option value="nomatter" selected>不限</option>
<option value="man">男</option>
<option value="women">女</option></select>
</div></td>
<td><div align="center">年 龄:</div></td>
<td><div align="left">
<select name="select2" size="1" class="smallinput" >
<option value="nomatter" selected>不限</option>
<option value="18">18-20</option>
<option value="25">21-25</option>
<option value="30">26-30</option>
<option value="50">31-50</option>
<option value="51">51以上..</option>
</select>
</div></td>
</tr>
<tr valign="middle" bgcolor="84C3FF">
<td height="23" bgcolor="#84C3FF"><div align="center">教师搜索:</div></td>
<td bgcolor="#84C3FF"><div align="left">
<input type="text" name="keyword" class="button" size=20 value="关键字" maxlength="50" onClick=Javascript:this.value='';>
</div></td>
<td colspan="2" bgcolor="#84C3FF"><div align="left">
<input type="submit" name="Submit" value="搜索" class="anniu">
</div></td>
</tr>
</table>
</div>
<div align="right"></div>
</form>
搜索页二
<!--#include file="inc/a.asp"-->
<!--#include file="format.asp"-->
<%
dim keyword
dim sql
dim findword
dim rs
keyword=request("keyword")
if keyword="" then
Response.Write ("<script language='JavaScript'>alert('请输入查询信息')</script>")
else
keyword=replace(replace(replace(replace(keyword,"'","‘"),"<","<"),">",">")," "," ")
if request("action")="title" then
findword="teacher_name like '%"&keyword&"%' "
elseif request("action")="content" then
findword="content like '%"&keyword&"%' "
elseif request("action")="writer" then
findword="writer like '%"&keyword&"%' "
else
findword="title like '%"&keyword&"%' "
end if
end if
set rs=server.createobject("adodb.recordset")
dim a,b
dim c,d
if request("bigxm_id")="" then
a=""
c="所有分类"
else
b="bigxm_id="&cstr(request("bigxm_id"))&" "
sql="select bigxm_name from bigxm where bigxm_id="&cstr(request("bigxm_id"))
rs.open sql,conn,1,1
c=rs("bigxm_name")
rs.close
end if
%>
<link rel="stylesheet" href="style.css" type="text/css">
<table width="778" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#EAEAEA">
<tr>
<td height="1" colspan="3" bgcolor="#FFFFFF"></td>
</tr>
<tr>
<td width="190" height="274" rowspan="4" valign="top" bgcolor="#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" bgcolor="#DCFAD8">
<div align="center"><font color="#000000">会员信息</font></div>
</td>
</tr>
<tr>
<td height="95"> <div align="center">
<table width="87%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><!--#include file="denglu.asp"--></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td height="25" bgcolor="#DCFAD8">
<div align="center"><font color="#000000">服务指南</font></div>
</td>
</tr>
<tr>
<td height="173" valign="top">
<%call fuwu()%>
</td>
</tr>
</table></td>
<td width="1" rowspan="4" bgcolor="#999999"></td>
</tr>
<tr>
<td height="25" bgcolor="#DCFAD8"> 家教信息网>>教师信息</td>
</tr>
<tr>
<td height="1" valign="top" background="images/bg_03b.gif" bgcolor="#FFFFFF"></td>
</tr>
<script language=Javascript>
<!--
function yuyue(){
if (confirm("你真的要发出预约信吗?")==1){
window.location="mail_teacher.asp?teacher_id=<%=rs("teacher_id")%>";
}
}
//-->
</script>
<tr>
<td valign="top" bgcolor="#FFFFFF"><table width="541" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="12" valign="top" bgcolor="#FFFFFF"><div align="center"></div></td>
</tr>
<tr>
<td width="541" height="240" valign="top">
<table width="95%" border="1" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="6%"><div align="center">ID</div></td>
<td width="16%"><div align="center">职称</div></td>
<td width="19%"><div align="center">所教科目</div></td>
<td width="26%"><div align="center">所住地区</div></td>
<td width="11%"><div align="center">收费</div></td>
<td width="11%"><div align="center">查看详情</div></td>
<td width="11%"><div align="center">状态</div></td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
if request("bigxm_id")="" then
sql="select * from teacher where "&findword&" "
sql=sql&" order by teacher_id desc"
else
sql="select * from teacher where "&b&" and "&findword&" "
sql=sql&" order by teacher_id desc"
end if
rs.open sql,conn,1,1
if rs.bof and rs.eof then
rs.close
response.write "<center><font color=red>没有查询到你要的信息!"
else
do while not rs.eof
%>
<tr>
<td><div align="center"><%=rs("teacher_id")%></div></td>
<td><div align="center"><%=rs("zhicheng")%></div></td>
<td><div align="center"><%=left(rs("teacher_name"),1)%>老师</div></td>
<td><div align="center"><%=rs("home1")%></div></td>
<td><div align="center"><%=rs("writer")%></div></td>
<td><div align="center"><a href="teacher_list.asp?teacher_id=<%=rs("teacher_id")%>">查看详情</a></div></td>
<td><div align="center">
<%if rs("zt")=0 then %>
<font color="#0099CC">未认证</font>
<% else %>
<font color="#FF0000">通过认证</font>
<% end if %>
</div></td>
</tr>
<%
rs.movenext
loop
rs.close
end if%>
</table></td>
</tr>
<tr>
<td height="12" valign="top" bgcolor="#FFFFFF"><div align="center"><br>
<br>
</div></td>
</tr>
</table></td>
</tr>
<tr bgcolor="#999999">
<td colspan="3" height="1"></td>
</tr>
<tr>
<td height="0" colspan="3" bgcolor="#FFFFFF"></td>
</tr>
</table>
<!--#include file="foot.asp"-->
</body>
</html>