<!--#include file="conn.asp"-->
<script language=javascript>
function check()
{if (document.form1.student.value=="")
{alert("请输入用户名");
document.form1.student.focus();
return false;}
if (document.form1.pwd.value=="")
{alert("请输入用户密码");
document.form1.pwd.focus();
return false;}
document.form1.ctype.value="add";
document.form1.submit();
}
</script>
<%
session.timeout=125
if trim(request("ctype"))="add" then
session("student")=""
session("classes")=""
session("number")=""
session("sex")=""
sql="select * from student where studentname='"&trim(request("student"))&"' and studentpassword='"&trim(request("pwd"))&"'"
set rs=conn.execute(sql)
if rs.eof then
%>
<script language=javascript>
alert("无此学员!请先注册");
</script>
<%else
session("student")=rs("studentname")
session("classes")=rs("class")
session("number")=rs("studentnumber")
session("sex")=rs("sex")
session("timen")=now
%>
<script language=javascript>
var now=new Date()
window.navigate("index.asp?time="+now.getTime());
</script>
<%end if
end if %>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网上考试系统</title>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<body topmargin="0" leftmargin="0">
<!--#include file="top.htm"-->
<div align="center">
<center>
<table border="0" cellpadding="4" style="border-collapse: collapse" bordercolor="#111111" width="778" height="100">
<tr>
<td align="center">
<table border="0" width="100%" id="table1">
<tr>
<td> </td>
<td>
<form name=form1 action=""><input type="hidden" name="ctype" >
<table border="0" cellpadding="5" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="300" id="table2">
<tr>
<td width="100" align="right">用户名:</td>
<td width="200">
<input type="text" name="student" size="20" class="line" style="border-style:solid; border-width:1px; padding:1px; height:22"></td>
</tr>
<tr>
<td align="right">密 码:</td>
<td>
<input type="password" name="pwd" size="20" class="line" style="height: 22; border-style: solid; border-width: 1px"></td>
</tr>
<tr>
<td> </td>
<td>
<input type="button" value="提交" name="B1" onClick="check()" class="line" style="width: 60; height: 22; border-style: solid; border-width: 1px; background-color: #FFFFFF">
<input type="reset" value="重置" name="B2" class="line" style="width: 60; height: 22; border-style: solid; border-width: 1px; background-color: #FFFFFF"></td>
</tr>
<tr>
<td> </td>
<td><a href="register.asp">新学生注册</a></td>
</tr>
<tr>
<td> </td>
<td><a href="admin/index.asp">后台管理程序入口</a></td>
</tr>
</table></td>
<td><img border="0" src="images/login.jpg" width="299" height="289"></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</div>
</body>
</html>
这个应该怎么弄.....