📄 add.asp
字号:
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>COAD System</title>
<link href="COAD.css" rel="stylesheet" type="text/css">
<%if session("userkey")<>4 then%>
<script language=javascript>
alert( "错误:您无权进行版面管理!" );
location.href = "javascript:history.back()"
</script>
<%end if%>
<SCRIPT LANGUAGE="JavaScript" src="images/js.js"></SCRIPT>
</head>
<body>
<table width="97%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#999999">
<tr>
<td height="25" bgcolor="#7C7CB5" ><div align="right"><A href="Admin_Exit.asp"><FONT color=#ffffff>退出网站</FONT></A> <A onclick="checkclick('您是否要打开本站首页?')" href="../index.asp" target=_blank><FONT color=#ffffff>网站首页</FONT></A></div></td>
</tr>
</table>
<table width="97%" bgcolor=#999999 cellspacing="1" cellpadding="5" align=center>
<tr bgcolor=#eeeeee>
<td colspan=2 align=right bgcolor="#eeeeee"> <div align="center">┊ <a href="add.asp">添加广告</a>
┊ <a href="list.asp">广告列表</a> ┊ <a href="list.asp?action=stop">过期广告</a>
┊<a href="code.asp"> 广告代码</a> ┊ <a href="config.asp">广告设置</a> ┊</div></td>
</tr>
</table>
<br>
<table width="97%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="DDDDDD">
<tr>
<td bgcolor="f1f1f1"><%
Dim rs,sql
if Request.Form("AddAD")<> "" then
'加入数据
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from [ad] where ADID='"&DangerEncode(Request.Form("ADID"))&"'"
rs.Open sql,conn,1,3
If not rs.eof Then
Response.Write ("<script>alert(' 操作错误! \n\n 广告ID重复,请使用其他ID !');history.back();</script>")
Response.end
End iF
rs.AddNew
rs("ADID")=DangerEncode(Request.Form("ADID"))
rs("ADType")=TRIM(Request.Form("ADType"))
rs("ADSrc")=DangerEncode(Request.Form("ADSrc"))
rs("ADHeight")=TRIM(Request.Form("ADHeight"))
rs("ADWidth")=TRIM(Request.Form("ADWidth"))
rs("ADLink")=DangerEncode(Request.Form("ADLink"))
rs("ADAlt")=DangerEncode(Request.Form("ADAlt"))
rs("ADStopViews")=TRIM(Request.Form("ADStopViews"))
rs("ADStopHits")=TRIM(Request.Form("ADStopHits"))
rs("ADStopDate")=TRIM(Request.Form("ADStopDate"))
rs("ADNote")=TRIM(Request.Form("ADNote"))
rs.Update
rs.Close
set rs=nothing
conn.Close
set conn=nothing
Response.Write "<font color=red>加入成功!"
end if
Rem 过滤可能出错误的符号
Function DangerEncode(fString)
If not isnull(fString) Then
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10), "")
fString = replace(fString, "'", """")
fString = Trim(fString)
DangerEncode = fString
End If
End Function
%> <br>
<table width="500" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999">
<form name=form action=add.asp method=post onsubmit="return chkinput()">
<tr align="center" bgcolor="c0c0c0">
<td height="22" colspan="2">添 加 新 广 告</td>
</tr>
<tr>
<td width="100" align="right" bgcolor="e3e3e3">广告 ID:</td>
<td width="400" bgcolor="e6e6e6">
<INPUT name=ADID type="text" class="input1" size="10" maxlength="20"> 不能重名</td>
</tr>
<tr>
<td align="right" bgcolor="e3e3e3">广告类型:</td>
<td bgcolor="e6e6e6">
<select size="1" name="ADType" class="input1" onChange="ChangeType(this.options[this.selectedIndex].value)">
<option selected value="1">普通显示</option>
<option value="2">满屏浮动显示</option>
<option value="3">上下浮动显示-右</option>
<option value="4">上下浮动显示-左</option>
<option value="5">全屏幕渐隐消失</option>
<option value="6">普通网页对话框 </option>
<option value="7">可移动透明对话框 </option>
<option value="8">打开新窗口</option>
<option value="9">弹出新窗口</option>
<option value="10">对联式广告</option>
</select></td>
</tr>
<tr>
<td align="right" bgcolor="e3e3e3" id="adsrc_text">广告地址:</td>
<td height="17" bgcolor="e6e6e6">
<INPUT name=ADSrc type="text" class="input1" value="http://" size=30> <a href="#" onclick=openhelp("ext")>图片或FLASH地址?</a></td>
</tr>
<tr>
<td align="right" bgcolor="e3e3e3">广告规格:</td>
<td height="17" bgcolor="e6e6e6">
<INPUT name=ADWidth type="text" class="input1" onkeypress="return Num();" value="468" size=8 maxlength=4>
×
<INPUT name=ADHeight type="text" class="input1" onkeypress="return Num();" value="60" size=8 maxlength=4></td>
</tr>
<tr>
<td align="right" bgcolor="e3e3e3">链接地址:</td>
<td height="17" bgcolor="e6e6e6">
<INPUT name=ADLink type="text" class="input1" size=30 maxlength=100></td>
</tr>
<tr>
<td align="right" bgcolor="e3e3e3">提示文字:</td>
<td height="17" bgcolor="e6e6e6">
<INPUT name=ADAlt type="text" class="input1" size=30 maxlength=50></td>
</tr>
<tr>
<td align="right" bgcolor="e3e3e3">投放限制:</td>
<td height="18" bgcolor="e6e6e6">
<INPUT name=ADStopViews type="text" class="input1" onkeypress="return Num();" value="0" size=8 maxlength=10>
·
<INPUT name=ADStopHits type="text" class="input1" onkeypress="return Num();" value="0" size=8 maxlength=10>
·
<INPUT name=ADStopDate type="text" class="input1" value="<%=year(date())%>-<%=month(date())+1%>-<%=day(date())%>" size=8 maxlength=19> <a href="#" onclick=openhelp("stop")>显示·点击·日期?</a></td>
</tr>
<tr>
<td align="right" bgcolor="e3e3e3">简单注释:</td>
<td height="17" bgcolor="e6e6e6">
<INPUT name=ADNote type="text" class="input1" size=30 maxlength=100> 备注不显示在广告中</td>
</tr>
<tr bgcolor="c0c0c0">
<td height="25" colspan="2" align="center">
<INPUT name="AddAD" type="submit" class="input1" value="确 定"> </td>
</tr>
</form>
</table>
<br></td>
</tr>
</table>
<br>
<table width="97%" height="30" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="DDDDDD">
<tr>
<td align="center" bgcolor="f1f1f1"><div align="center"><!--#Include file="end.asp" -->
</div></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -