📄 adminsave3.asp
字号:
<%
if session("admin")="" then
response.redirect "admin.asp"
end if
%>
<!--#include file="conn.asp"-->
<!--#include file="char.asp"-->
<%
dim rs,sql
dim title
dim content
dim articleid
dim classid,Nclassid
dim Nkey
dim writer
dim writefrom
dim errmsg
dim founderr
dim htmlable
founerr=false
if trim(request.form("txttitle"))="" then
founderr=true
errmsg="<li>文章名不能为空</li>"
end if
if trim(request.form("txtcontent"))="" then
founderr=true
errmsg=errmsg+"<li>文章内容不能为空</li>"
end if
if trim(request.form("key"))="" then
founderr=true
errmsg=errmsg+"<li>请输入文章关键字</li>"
end if
if trim(request.form("yc"))="请选择来源" then
founderr=true
errmsg=errmsg+"<li>请输入文章来源</li>"
end if
if trim(request.form("Nclassid"))="" then
founderr=true
errmsg=errmsg+"<li>文章栏目不能为空</li>"
end if
if founderr=false then
title=htmlencode(request.form("txttitle"))
Nkey=htmlencode(trim(request.form("key")))
classid=request.form("classid")
Nclassid=request.form("Nclassid")
htmlable=request.form("htmlable")
content=request.form("txtcontent")
articleid=request("articleid")
set rs=server.createobject("adodb.recordset")
sql="select * from article where articleid="&articleid
rs.open sql,conn,1,3
rs("title")=title
rs("content")=content
rs("Nclassid")=Nclassid
rs("classid")=classid
rs("Nkey")=Nkey
rs("htmlable")=htmlable
if request.form("writer")<>"" then
rs("writer")=trim(request.form("writer"))
end if
if request.form("writefrom")<>"" then
rs("writefrom")=trim(request.form("writefrom"))
end if
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing%>
<html>
<head>
<title></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<div align="center"><center>
<br><br>
<table width="50%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr>
<td width="100%" bgcolor="#999999" height="20">
<p align="center"><font color="#FFFFFF"><b> 修改文章成功</b><%=rs("daifa")%></font>
</td>
</tr>
<tr>
<td width="100%"><p align="left"><br>
文章序号为:<%response.write "article"&articleid&""%><br>
文章标题为:<%response.write title%></p>
您可以进行其他操作 <a href="logout.asp" target="_blank">返回首页</a></td>
</tr>
</table>
</center></div>
<%
else
response.write "由于以下的原因不能保存数据:"
response.write errmsg
end if
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -