网络考场(8)(转)taddstudent.asp

网络

<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<%
if Request.ServerVariables("http_method")="POST" and Request.Form("submit")<>"跳到" then
    '如果按POST方式提交表单内容
    set conn=server.CreateObject("adodb.connection")
    conn.ConnectionString="dsn=testsys"
    conn.Open
    strstid=Request.Form("stid")
    strstname=Request.Form("stname")
    if Request.Form("submit")="加入" then
    '如果执行加入学生信息的请求
        strsql="select * from studentinfo where stid='" & strstid & "'"
        '根据要加入的学生学号查询数据库的表studentinfo中是否存在该学生的记录
        set mrs1=conn.Execute(strsql)
        if  not(mrs1.BOF and  mrs1.EOF) then
        '如果要加入的学生学号已存在,则提示重新输入信息        
            Response.Write "该学号已经存在,请重新输入学生信息<br>"
            Response.Write "<a href=taddstudent.asp?page=" & request("page") & "&stname=" & strstname & "&stid=" & strstid & ">返回</a>"
        else
        '如果要加入的学生学号不存在,则向数据库中加入该学生信息    
        strsql="insert into studentinfo (stname,stid) values ('" & strstname & "','" & strstid & "')"
        conn.Execute(strsql)
        strstid=""
        strstname=""
        end if
    end if
    if Request.Form("submit")="删除" then
    '如果是删除学生信息请求
        strsql="delete * from studentinfo where stid='" & strstid & "'"
        '删除学生信息
        conn.Execute(strsql)
        '删除学生的考试成绩
        strsql="delete * from score where stid='" & strstid & "'"
        conn.Execute(strsql)
        strstid=""
        strstname=""
    end if
    conn.Close
    set conn=nothing
    else
        strstname=Request.QueryString("stname")
        strstid=Request.QueryString("stid")
end if
%>
<FORM action="taddstudent.asp" method=POST id=form1 name=form1>
<P><FONT face="幼圆" size=3 color=Crimson>学生信息</FONT><BR>
<FONT face="" size=3>姓名:
<INPUT id=stname name=stname value=<%=strstname%>></FONT><BR>
<FONT face="" size=3>学号:
<INPUT id=stid name=stid value=<%=strstid%>></FONT>
<FONT face="" size=3> 
<INPUT id=submit1 name=submit type=submit value=加入>
<INPUT id=submit2 name=submit type=submit value=删除>
</FONT></P><FONT face="" size=3>
<HR>
</FONT>
<P>
<TABLE border=0 cellPadding=1 cellSpacing=1 width=75%>
    <TR bgcolor=Honeydew>
        <TD>姓名</TD>
        <TD>学号</TD></TR>
<%
set mrs=server.CreateObject("adodb.recordset")
mrs.ActiveConnection="dsn=testsys"
mrs.Source="select

时间: 2024-12-03 19:22:27

网络考场(8)(转)taddstudent.asp的相关文章

网络考场(6)(转)stselectsub.asp

select|网络 <%@ Language=VBScript %><%if Request.Form("selsub")<>"" then'如果选择了考科目,则进入考试界面    marray=split(Request.Form("selsub"),",")    '保存考试科目的教师编号    session("teachid")=trim(marray(0))    '

网络考场(2)(转)screatefrm1.asp

<%@ Language=VBScript %><html><head><title>网络考场</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><frameset rows="*" cols="120,509*" borde

网络考场(4)(转)smessage.asp

<%@ Language=VBScript %><%'计算考试已过时间gotime=hour(now())*60+minute(now())-hour(session("starttime"))*60-minute(session("starttime"))'计算考试剩余时间lefttime=session("testtime")-gotime%><HTML><HEAD><META http-

网络考场(1)(转)logon.asp

<%@ Language=VBScript %><%if Request.ServerVariables("http_method")="POST" then    if Request.Form("submit")="进入1" then        '学生进入网络考场的处理        set conn=server.CreateObject("adodb.connection") 

网络考场(13)(转)testtop.asp

网络 <%@ Language=VBScript %><HTML><HEAD><META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"></HEAD><BODY><P align=center><STRONG><FONT color=crimson face=幼圆 size=4>网络考场:<

网络考场(7)(转)taddquestion.asp

网络 <%@ Language=VBScript %><%if Request.ServerVariables("http_method")="POST" then    if Request.Form("submit")="加入" then    '处理加入试题请求        set mrs=server.CreateObject("adodb.recordset")        

网络考场(16)(转)tselectsub.asp

select|网络 <%@ Language=VBScript %><%Response.Buffer=true%><HTML><HEAD><META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"></HEAD><BODY bgColor=Azure><%if Request.QueryString("a

网络考场(10)(转)tcreatefrm2.asp

网络 <%@ Language=VBScript %><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><frameset rows="*" cols="120,

网络考场(15)(转)tselcourse.asp

网络 <%@ Language=VBScript %><HTML><HEAD><META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0"></HEAD><BODY><P align=center><FONT color=crimson face=幼圆 size=4><STRONG>选择要查看的课程&