<%@ language=vbscript %>
<%
if request.servervariables("http_method")="post" then
if request.form("submit")="进入1" then
学生进入网络考场的处理
set conn=server.createobject("adodb.connection")
conn.connectionstring="dsn=testsys"
连接并打开数据库
conn.open
strsql="select * from studentinfo where stid=" & request.form("stid") & " and stname=" & request.form("stname") & ""
set mrs=conn.execute(strsql)
if not mrs.bof and not mrs.eof then
如果数据库中存在该学生的记录进入网络考场
并用session属性存储学生的姓名与学号
session("stid")=request.form("stid")
session("stname")=request.form("stname")
response.redirect "stselectsub.asp"
set mrs=nothing
else
如果数据库中不存在该学生的信息,显示的页面仍为logon.asp,并提示信息
response.write "学生姓名与学号输入错误!!"
end if
conn.close
set conn=nothing
else
教师进入网络考场的处理
set conn=server.createobject("adodb.connection")
conn.connectionstring="dsn=testsys"
conn.open
strsql="select * from teacherinfo where teachid=" & request.form("teachid") & " and teachname=" & request.form("teachname") & ""
set mrs=conn.execute(strsql)
if not mrs.bof and not mrs.eof then
如果数据库中存在该教师的记录进入网络考场
用session属性保持教师姓名与编号
session("teachid")=request.form("teachid")
session("teachname")=request.form("teachname")
response.redirect "tcreatefrm2.asp"
else
如果数据库中不存在该教师的信息,显示的页面仍为logon.asp,并提示信息
response.write "教师的姓名和编号输入错误!!"
end if
set mrs=nothing
关闭数据库连接
conn.close
清空对象变量
set conn=nothing
end if
end if
%>
<html>
<head>
<meta name="generator" content="microsoft visual studio 6.0">
</head>
<body>
<form action="logon.asp" method=post id=form1 name=form1>
<p align=center>
<font color=crimson face=隶书 size=6>网 络 考 场</font></p>
<p align=center>
<table border=0 cellpadding=1 cellspacing=1 width=75%>
<tr bgcolor=wheat>
<td>
<div align=center><strong><font
color=mediumslateblue face=幼圆 size=4>学 生</font></strong></div>
<td>
<div align=center><font color=mediumslateblue
face=幼圆 size=4><strong>教
师</strong></font></div>
<tr bgcolor=ivory>
<td>
<p align=center>姓名<input id=text1 name=stname></p></td>
<td>
<p align=center>姓名<input id=text2 name=teachname value=zhong></p></td></tr>
<tr bgcolor=ivory>
<td>
<p align=center>学号<input id=password1 name=stid type=password></p></td>
<td>
<p align=center>编号<input id=password1 name=teachid type=password ></p></td></tr>
<tr bgcolor=ghostwhite>
<td >
<div align=center><input id=submit1 name=submit type=submit value=进入1 ></div></td>
<td>
<div align=center><input id=submit2 name=submit type=submit value=进入2></div></td></tr></table></p>
</form>
</body>
</html>
网络考场(1)(转)logon.asp
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 网络考场(1)(转)logon.asp
相关推荐
- 暂无文章
