📄 addtg.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<!--#include file="top.asp"-->
<%
response.Write("<table border=0 align=center cellpadding=3 cellspacing=1 class=tablecolor>")
response.Write("<tr><td height=25 align=center class=banner>网站推广管理</td><td width='20%' align=center class=banner><a href=addtg.asp>添加数据</a></td></tr></table>")
select case request("action")
case "savejxs"
call savejxs()
case else
call normal()
end select
sub normal()
dim id,wsname,wspic,wsurl,wssend,Content,sortnum
id=request.QueryString("id")
if id<>"" then
dim rs
set rs=conn.execute("select * from sprerd where id="&clng(id))
if rs.bof and rs.eof then
response.Write("<script>alert('该条记录不存在或者已被删除!');history.back()</script>")
response.End()
end if
wsname=rs("wsname")
wspic=rs("wspic")
wsurl=rs("wsurl")
wssend=rs("wssend")
Content=rs("Content")
sortnum=rs("sortnum")
rs.close
set rs=nothing
end if
response.Write("<script src='../inc/ubbcode.js'></script>")
response.Write("<table border='0' align='center' cellpadding='3' cellspacing='1' class='tablecolor'>")
response.Write("<form action='?action=savejxs' method=POST name=frmAnnounce>")
response.Write("<tr><td width='30%' class='tablebody'><strong>ID</strong></td><td class='tablebody'>"&id&"</td></tr>")
response.Write("<tr><td width='30%' class='tablebody'><strong>排序</strong></td><td class='tablebody'><input name=sortnum class=FormClass value='"&sortnum&"' maxlength=30></td></tr>")
response.Write("<tr><td width='30%' class='tablebody'><strong>推广名称</strong></td><td class='tablebody'><input name=wsname class=FormClass value='"&wsname&"' maxlength=30></td></tr>")
response.Write("<tr><td class='tablebody'><strong>网站图标</strong></td><td class='tablebody'><input name='wspic' type='text' id='wspic' value='"&wspic&"' maxlength='30'></td></tr>")
response.Write("<tr><td class='tablebody'><strong>链接地址</strong></td><td class='tablebody'><input name='wsurl' type='text' id='wsurl' value='"&wsurl&"' maxlength='30'></td></tr>")
response.Write("<tr><td class='tablebody'><strong>发送方式</strong></td><td class='tablebody'><input name='wssend' type='text' id='wssend' value='"&wssend&"' maxlength='30'></td></tr>")
response.Write("<tr><td valign='top' class='tablebody'><b>内容说明</b><br><li>HTML标签:√<li>UBB标签:√<li>贴图标签:×<li>多媒体标签:×<p><br><br></p></td>")
response.Write("<td valign='top' class='tablebody'>")
%>
<!--#include file="../inc/getubb.asp"-->
<%
response.Write("<textarea cols=60 name=Content rows=12 wrap=VIRTUAL>"&Content&"</textarea></td></tr>")
response.Write("<tr><td align='center' class='tablebody'> </td><td class='tablebody'><input type='hidden' name='id' value='"&id&"'><input type=Submit value='发 表' name=Submit> <input type=reset name=Submit2 value='清 除'> <a href='sprerd.asp'>返回列表</a></td></tr></form></table>")
end sub
sub savejxs()
dim id,wsname,wspic,wsurl,wssend,Content,sortnum
id=request.Form("id")
wsname=checkStr(request.Form("wsname"))
wspic=checkStr(request.Form("wspic"))
wsurl=checkStr(request.Form("wsurl"))
wssend=checkstr(request.Form("wssend"))
Content=checkstr(request.Form("Content"))
sortnum=checkstr(request.form("sortnum"))
If sortnum="" then
sortnum=0
end if
if not isnumeric(sortnum) then
response.Write("<script>alert('排序错误:非数字型字段!');history.back()</script>")
response.End()
end if
if wsname="" then
response.Write("<script>alert('名称不能为空!');history.back()</script>")
response.End()
end if
dim ip
ip=Request.ServerVariables("HTTP_REFERER")
if id<>"" then
conn.execute("update sprerd set wsname='"&wsname&"',wspic='"&wspic&"',wsurl='"&wsurl&"',wssend='"&wssend&"',Content='"&Content&"',sortnum="&sortnum&" where id="&clng(id)&"")
response.Write("<script>alert('更新成功!');location='"&ip&"'</script>")
response.End()
else
conn.execute("insert into sprerd (wsname,wspic,wsurl,wssend,Content,sortnum) values('"&wsname&"','"&wspic&"','"&wsurl&"','"&wssend&"','"&Content&"',"&sortnum&")")
response.Write("<script>alert('添加成功!');location='"&ip&"'</script>")
response.End()
end if
end sub
%>
<%CloseConn%>
<!--#include file="end.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -