adminsubjectsave.asp

来自「网络考试系统最终备份」· ASP 代码 · 共 48 行

ASP
48
字号
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
.STYLE2 {
	font-family: "宋体";
	color: #000000;
}
.STYLE3 {color: #000000}
-->
</style>

<!--#include file="conn.inc"-->
<%


exam_subject=trim(request("exam_subject"))
sql="select * from subject_info where SubName = '"&exam_subject&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
if(rs.eof) then

isAdd = 1

else
isAdd = 0
end if
rs.close
set rs= nothing

if isAdd = 1 then
sql="select * from subject_info"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
rs.addnew
'增加新的科目
rs("SubName")=exam_subject
rs.update
response.redirect "adminsubject.asp"
else
%>
 <td colspan="2">
<font color="#FF0000">error:添加科目重复</font>
<a href="adminsubject.asp">返回</a>
<font color="#FF0000">重新添加</font>
</td>
<%end if%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?