⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adminsave.asp

📁 这是一个文章管理的网页源程序
💻 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 yc
    dim htmlable
	dim daifa
	dim hits
	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 trim(request.form("daifa"))="审核结果" 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")
        yc=request.form("yc")
		daifa=request.form("daifa")
        htmlable=request.form("htmlable")
		content=request.form("txtcontent")
	set rs=server.createobject("adodb.recordset")
	sql="select * from article where (articleid is null)" 
	rs.open sql,conn,1,3
	rs.addnew
	rs("title")=title
	rs("content")=content
	rs("Nclassid")=Nclassid
	rs("classid")=classid
	rs("Nkey")=Nkey
	rs("htmlable")=htmlable
	rs("yc")=yc
	rs("daifa")=0
	if request.form("writer")<>"" then
		ytname=request.form("writer")	
		rs("writer")=trim(ytname)
	end if
	if request.form("writefrom")<>"" then
		rs("writefrom")=trim(request.form("writefrom"))
	end if
	rs("dateandtime")=date()
%>
<%	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></font></td>
  </tr>
  <tr>
    <td width="100%"><p align="left"><br>
        文章序号为:<%response.write 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 + -