📄 admin_write.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="include.asp"-->
<!--#include file="admin_cookie.asp"-->
<!--#include file="setup.asp"-->
<!--#include file="tohtml.asp"-->
<!--#include file=head.asp-->
<html>
<head>
<title>write</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META name=KEYWORDS content="驰志网络资源交流中心,www.58down.com">
<meta NAME="author" CONTENT="驰志网络">
<meta NAME="copyright" content="Copyright 2003-2008 - 驰志网络 - 不飞的天使">
<link href="favicon.ico" rel="shortcut icon">
<link href="Style.css" rel="stylesheet" type="text/css">
<%
function w(a,b)
set fso=server.createobject("scripting.filesystemobject")
set fp=fso.createtextfile(server.mappath(a))
fp.write(b)
end function
%>
<%
if request("submit")<>"" then
title=server.htmlencode(trim(request("title")))
nr=to_html(request("nr"))
nrtodata=server.htmlencode(trim(request("nr")))
user=server.htmlencode(trim(request("user")))
response.expires=0
response.buffer=true
if user="" then err("你的用户名不能为空")
if title="" then err("你的标题不能为空")
if nr="" then err("你的内容不能为空")
if len(title)>60 then err("你的标题不能大于30个汉字")
if len(nr)>60000 then err("你的内容不能大于30000个汉字")
if request("class")="" then err("你的类别不能为空!")
set conn=server.createobject("adodb.connection")
conn.open connstr
set rs=server.createobject("adodb.recordset")
rs.open "select * from wz",conn,1,3
rs.addnew
rs("title")=title
rs("nr")=nrtodata
rs("class")=request("class")
rs("user")=user
rs("date")=date()
rs("count")="1"
rs("num")=num
rs.update
conn.execute("update config set num=num+1")
file="58down/"&rs("num")&".htm"
'************** 文章内容模版开始 ***************
main= "<html><title>"&rs("title")&":"&webtitle&"</title><meta http-equiv=Content-Type content=text/html; charset=gb2312><link href=../Style.css rel=stylesheet type=text/css></head><table width=750 border=0 align=center cellpadding=0 cellspacing=0><tr> <td width=150><img src=../logo.gif></td><td height=80> </td></tr></table><table width=750 border=0 align=center cellpadding=0 cellspacing=0><tr> <td width=150><img src=../213cn_gif/ar.gif> <a class=SoftMeun href=../index.asp>"&webtitle&"</a><b>:</b>"&rs("class")&"</td></tr></table><table width=750 border=0 align=center cellpadding=5 cellspacing=1 bgcolor=#dddddd><tr><td height=30 align=center bgcolor=#F2F2F2><strong><font color=#000000>"&rs("title")&"</font></strong></td></tr><tr><td bgcolor=#FFFFFF><br><div align=center>作者:"&rs("user")&" 加入时间:"&rs("date")&"</div><br><strong>内容: </strong><br><br> "&to_html(rs("nr"))&"</td></tr></table><br><table width=100% border=0 align=center cellpadding=0 cellspacing=0><tr><td height=2 align=center bgcolor=#DDDDDD></td></tr></table><TABLE cellSpacing=0 cellPadding=0 width=100% border=0><TR><TD bgColor=#f9f9f9 height=60><table width=750 height=60 border=0 align=center cellpadding=0 cellspacing=0><tr><td height=15></td></tr><tr><td align=center height=20>驰志网络版权所有 2003-2005 | 法律声明 | 服务条款 | 隐私声明 | 联系我们 | 广告服务</td></tr><tr><td height=25></td></tr></table></TD></TR></TABLE></body></html>"
'************** 文章内容模版结束 ***************
w file,main
response.write "<table width=90% align=center><tr><td height=120 valign=middle bgcolor=#FFFFFF><div align=center>发表成功..<br><a class=SoftMeunhref="&self&">返回,继续添加文章</a><br><a class=SoftMeun target=_blank href=58down/"&rs("num")&".htm>查看刚添加的文章</a></div><meta http-equiv='refresh' content='2 url="&self&"'></table>"
session("cla")=request("class")
conn.close
else
%>
<%
set conn=server.createobject("adodb.connection")
conn.open connstr
set rs=conn.execute("select * from class order by num asc")
%>
<html>
<head>
<title><%=webtitle%>发表主题</title>
</head>
<body>
<table width=90% align=center cellpadding=3 cellspacing=1 bgcolor=#000000>
<tr><td bgcolor=#FFFFFF>
<table width=98% align=center>
<tr><td class=tdzw>
<br>
<table align=center cellpadding=3 cellspacing=1 class=table width=90%>
<tr><td class=td align=center>发表主题</table>
<form name=form1 method=post action=<%=self%>>
<table align=center cellpadding=3 cellspacing=1 bgcolor=#000000 width=90%>
<tr> <td bgcolor=#FFFFFF>
用户名: <td bgcolor=#FFFFFF> <input name=user class="inpute" value="<%=superadmin%>">
<tr> <td bgcolor=#FFFFFF valign=top>
标题: <td bgcolor=#FFFFFF><input class="inputf" maxlength=50 name=title size=40 onkeydown="if(event.keyCode==13)event.keyCode=9"> 不能大于30个汉字
<tr>
<td bgcolor=#FFFFFF valign=top>内容:<td bgcolor=#FFFFFF>
<img src="map/toolbar.gif" width="139" height="22" align="absmiddle" usemap="#Map" border="0">
<tr><td bgcolor=#FFFFFF><td bgcolor=#FFFFFF>
<textarea name=nr class="input4" rows=10 cols=50 ></textarea>
<tr>
<td bgcolor=#FFFFFF>所属类别:
<td bgcolor=#FFFFFF>
<select name=class>
<option value=<%=session("cla")%>><%=session("cla")%></option>
<%
do while not rs.eof
response.write "<option value="&rs("class")&">"&rs("class")&"</option>"
rs.movenext
loop
%>
</select>
<tr>
<td bgcolor=#FFFFFF colspan=2 align=center> <input class="input1" type=submit value="提交" name=submit>  <input type=reset class="input1" value="取消">
</table>
<br></table>
</table>
</html>
<%end if%>
<SCRIPT>
function addcode(code)
{ var tmp=code
form1.nr.value=form1.nr.value+tmp;
}
</script>
<map name="Map">
<area shape="rect" coords="1,1,23,23" href="javascript:addcode('[b]文字[/b]');" alt="粗体字">
<area shape="rect" coords="23,1,45,21" href="javascript:addcode('[i]文字[/i]');" alt="斜体字">
<area shape="rect" coords="45,1,69,20" href="javascript:addcode('[u]文字[/u]');" alt="下划线文字">
<area shape="rect" coords="69,1,91,22" href="javascript:addcode('[url=链接地址]说明[/url]');" alt="插入网址">
<area shape="rect" coords="92,0,115,22" href="javascript:addcode('[email=电子信箱地址]说明[/email]');" alt="插入电子邮件">
<area shape="rect" coords="115,1,138,22" href="javascript:addcode('[img]图片链接地址[/img]');" alt="插入图片">
</map>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -