📄 admin.post.asp
字号:
<!--#include file="conn.Asp" -->
<!--#include file="admin.Asp" -->
<html>
<%if Request("post")="go" then%>
<!--#include file="inc/UBBCode.Asp" -->
<%
if len(Request("title"))>255 or Request("title")="" then error="标题长度不能大于255个字节! <a href=# onClick='history.go(-1)' >点击返回</a>"
if len(Request("name"))>50 or Request("name")="" then error="标题长度不能大于50个字节! <a href=# onClick='history.go(-1)' >点击返回</a>"
if error<>"" then
Response.Write(error)
Response.End
Else
%>
<p align="center"><b><font color="#FF0000">请仔细检查一下你提交的文章,如果确定无误</font></a></b><br><b><font color="#FF0000">请点击这里(</font><a href="?post=ok&id=<%=Request("id")%>">完成提交</a><font color="#FF0000">)
如果发现错误请(</font><a href=# onClick='history.go(-1)' >返回</a><font color="#FF0000">)</font></b><p>
<%
Response.Write "一级分类:"&HTMLEncode(Request("r1"))&"<p>"
Response.Write "二级分类:"&HTMLEncode(Request("r2"))&"<p>"
Response.Write "标题:"&HTMLEncode(Request("title"))&"<p>"
Response.Write "内容:"&UBBCode(HTMLEncode(Request("content")),1)&"<p>"
Response.Write "作者:"&HTMLEncode(Request("name"))&"<p>"
Response.Write "时间:"&HTMLEncode(Request("time"))&"<p>"
Session("title_1")=HTMLEncode(Request("r1"))
Session("title_2")=HTMLEncode(Request("r2"))
Session("title")=HTMLEncode(Request("title"))
Session("text")=UBBCode(HTMLEncode(Request("content")),1)
Session("name")=HTMLEncode(Request("name"))
Session("time")=HTMLEncode(Request("time"))
Session("ubb")=Request("content")
Response.End
End if
End if
%>
<%
if Request("post")="ok" and Request("id")="" then
set rsa = Server.CreateObject("adodb.recordset")
rsa.open "select * from title ",conn,1,3
rsa.addnew
rsa("title_1")=Session("title_1")
rsa("title_2")=Session("title_2")
rsa("title")=Session("title")
rsa("text")=Session("text")
rsa("name")=Session("name")
rsa("time")=Session("time")
rsa("ubb")=Session("ubb")
rsa("tshow")=true
rsa.update
Response.Write("添加成功! <a href='admin.article.asp'>点击返回</a>")
Response.End
End if
if Request("post")="ok" and Request("id")<>"" and isnumeric(Request("id")) then
set rsu = Server.CreateObject("adodb.recordset")
rsu.open "select * from title where id = "&Request("id")&" ",conn,1,3
rsu("title_1")=Session("title_1")
rsu("title_2")=Session("title_2")
rsu("title")=Session("title")
rsu("text")=Session("text")
rsu("name")=Session("name")
rsu("time")=Session("time")
rsu("ubb")=Session("ubb")
rsu("tshow")=true
rsu.update
Response.Write("修改成功! <a href='admin.article.asp'>点击返回</a>")
Response.End
End if
%>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>添加文章</title>
</head>
<style>
<!--
body, table, tr, td, p, a, html, select, option, input { font-family: 宋体; font-size: 9pt; text-decoration: none; color: #000000; line-height:150% }
A:hover { FONT-SIZE: 9pt; COLOR: #FF0000; FONT-FAMILY: 宋体; TEXT-DECORATION: none }
-->
</style>
<style type=text/css></style>
<script src="inc/ubbcode.js"></script>
<script src="inc/selectlist.js"></script>
<script src="inc/checkform.js"></script>
<body>
</p>
<div align="center">
<form name="myform" method="POST" action="?post=go&id=<%=Request("id")%>">
<center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse; border: 4px double #808080; padding: 3" bordercolor="#111111" width="750">
<tr>
<td width="100%">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="100%">
<tr>
<td width="100%" height="30">
<p align="center"><b>添加修改文章</b></td>
</tr>
<tr>
<td width="100%"><hr noshade color="#000000" size="1"></td>
</tr>
<tr>
<td width="100%" height="30">
请选择一组分类:<select onchange="window.location='?id=<%=Request("id")%>&title=<%=Request("title")%>&r1='+this.value" name="r1">
<option <%if Request("r1")="" then Response.Write("selected")%> >请选择一级分类</option>
<%
'一级分类
set rsr1=server.createobject("adodb.recordset")
rsr1.open "select * from title_1",conn,1,3
if not rsr1.eof then
for r1 = 1 to rsr1.recordcount
%>
<option value="<%=rsr1("title_1")%>" <%if Request("r1")=rsr1("title_1") then Response.Write("selected")%>><%=rsr1("title_1")%></option>
<%
rsr1.movenext
if rsr1.eof then exit for
next
End if
rsr1.close
set rsr1 = nothing
%>
</select>
请选择二级分类:<select name="r2">
<option selected >请选择二级分类</option>
<%
if Request("r1")<>"" then
set rsr2=server.createobject("adodb.recordset")
rsr2.open "select * from title_2 where title_1 = '"&HTMLEncode(Request("r1"))&"' ",conn,1,3
if not rsr2.eof then
for r2 = 1 to rsr2.recordcount
%>
<option value="<%=rsr2("title_2")%>" <%if Request("r2")=rsr2("title_2") then Response.Write("selected")%>><%=rsr2("title_2")%></option>
<%
rsr2.movenext
if rsr2.eof then exit for
next
End if
rsr2.close
set rsr2 = nothing
End if
%>
</select></td>
</tr>
<tr>
<td width="100%" height="30">标题:<input type="text" name="title" size="68" style="border: 1px solid #808080; padding: 0" value="<%=Request("title")%>">
小于255个字节</td>
</tr>
<tr>
<td width="100%"><!--#include file="inc/ubb.asp" --></td>
</tr>
<tr>
<td width="100%">
<p>
<textarea name="content" rows="15" cols="98" class="Content" style="border: 1px solid #808080; padding: 0"><%
if Request("id")<>"" and isnumeric(Request("id")) then
set rsubb=server.createobject("adodb.recordset")
rsubb.open "select * from title where id = "&Request("id")&" ",conn,1,3
if not rsubb.eof then
Response.Write rsubb("ubb")
End if
rsubb.close
set rsubb = nothing
End if
%></textarea></td>
</tr>
<tr>
<td width="100%" height="30">作者名称:<input type="text" name="name" size="20" style="border: 1px solid #808080; padding: 0" value="admin">
发表时间:<input type="text" name="time" size="20" style="border: 1px solid #808080; padding: 0" value="<%=date()%>"> </td>
</tr>
<tr>
<td width="100%" height="30">
<p align="center">
<input type="submit" name="Submit" value=" 提交 " class=button style="border: 1px solid #808080; padding: 0; width:60; height:20"></td>
</tr>
</table>
</td>
</tr>
</table>
</center>
</from>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -