我的这个程序是用来控制一个同学只可以选3个题目 但是出错了 不知道错在那么 各位大哥大姐帮我看看啊
<!--#include file="conn.asp"-->
<!--#include file="top1.asp"-->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type"
content="text/html; charset=gb2312">
</head>
<%
if request("submit")="提交内容" then
xm=request("xm")
xh=request("xh")
bj=request("bj")
keyid=cstr(request("keyid"))
leibie=cstr(request("leibie"))
set
rs=server.createobject("adodb.recordset")
sql="select * from xuanti
where (id is null)"
rs.open sql,conn,1,3
rs.addnew
rs("xm")=xm
rs("xh")=xh
rs("bj")=bj
rs("timu")=keyid
rs("leibie")=leibie
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
<!-- sub message
dim shuzi
shuzi=1
Set rs= Server.CreateObject("ADODB.Recordset")
sql="select * from xuti where xm= "& xm
shuizi= shuzi+1
if rs.bof and rs.eof then response.Write
if shuzi<=3 then
shuizi= shuzi+1
response.write "选题成功,<a
href=setclass.asp>[请单击这里返回]</a>"
else
response.write "您已经选了三个题目,不可以在
选了!<a href=index.asp>[请单击这里返回]</a>"
end sub
call message
-->
<script language="JavaScript"
type="text/JavaScript">
function check()
{
if(document.form1.xm.value=="")
{
alert("姓名不能为空!");
document.form1.xm.focus();
return false;
}
if(document.form1.xh.value=="")
{
alert("学号不能为空!");
document.form1.xh.focus();
return false;
}
if(document.form1.bj.value=="")
{
alert("题目类别不能为空!");
document.form1.bj.focus();
return false;
}
return true;
}
</script>
<body>
<form name="form1" method="post"
action="saveclass.asp" onSubmit="return
check();">
<p> </p>
<p> </p>
<p> </p>
<table width="400" border="0"
align="center">
<tr>
<td>姓名</td>
<td><input type="text"
name="xm"></td>
<input type="hidden"
name="keyid" value="<%=request("id")%>">
<input type="hidden"
name="leibie" value="<%=request("leibie")%>">
</tr>
<tr>
<td width="24%">学号</td>
<td width="76%"><input type="text"
name="xh"></td>
</tr>
<tr>
<td>班级</td>
<td><input type="text" name="bj"></td>
</tr>
<tr>
<td><input type="submit" name="Submit"
value="提交内容"> </td>
<td><input type="button" name="retset"
onClick="javascript:window.close();"value="放
弃选课"></td>
</tr>
</table>
</form>
</body>
</html>