最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
网络考场(1)(转)logon.asp
时间:2008-01-18 编辑:简简单单 来源:一聚教程网
<%
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
-
上一个: Asp组件中级入门与精通系列之六
-
下一个: 超酷的通用分页显示控制 (一) 基本原型
相关文章
- asp 把UTF8转换GB2312代码 05-01
- 网络考场(5)(转)stestmain.asp 01-18
- 网络考场(9)(转)taddsub.asp 01-18
- 网络考场(3)(转)sevalue.asp 01-18
- 网络考场(4)(转)smessage.asp 01-18
- 网络五子棋代码2(adminaster.asp 转) 01-18