addsectiondone.asp

来自「Activity——活动管理模块 Analyse——分析模块 Client—」· ASP 代码 · 共 52 行

ASP
52
字号
<%

%>
<!--#include file='../conn.asp'-->

<%
SectionName = request("SectionName")				'获得部门名
SectionName = replace(SectionName,"'","''")			'替换部门名中的'符号
set rs = conn.execute("select * from Section where sectionName ='"&SectionName&"'")  '读取不盟数据
if not (rs.bof or rs.eof) then										'如果部门名重复
				response.write "<script language=javascript>"		'JavaScript
				response.write"alert('该部门已经存在!');"			'警告
				response.write"location.href='addSection.asp';"		'返回到添加部门页面
				response.write "</script>"							'JavaScript结束
				response.end										'停止解析,立即执行JavaScript
end if
sql="insert into Section (SectionName)  values('"&SectionName&"')"	'如果没有重复,添加数据到数据库
conn.execute( sql )

%>
<html>
<head>
<title>添加新部门</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"><META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<LINK 
href="../css.css" type=text/css rel=stylesheet>
</head>

<body>

<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0" align=center>
  <tr>
    <td width="100%" height="197" align="center">
<table border="0" cellspacing="0" cellpadding="0" height="85" bgcolor="#99ccff" width="100%">
<tr>
<td align="center">
<a href="addSection.asp" class=linkblue2>已创建新部门记录</a>
<script>
	setTimeout("location.replace('addSection.asp')",2000)
</script>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>

</body>
</html>

⌨️ 快捷键说明

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