"拔出数据库毗连文件
<!--#include file="conn.asp"-->
"拔出注释HTM代码文件,下一节将为人人引见,次要是对HTM代码停止转化,以避免呈现页面格局上的凌乱,并且也更便利对手艺性文章的宣布
<!--#include file="articlechar.inc"-->
"假如不是从办理页面进入,则转到验证办理员信息页面
<%
if request.cookies("adminok")="" then
response.redirect "login.asp"
end if
%>
<%
dim typename
dim title
dim content
dim sql
dim rs
dim articleid
dim typeid
"承受从addarticle.asp处前往的文章内容信息,这里的htmlencode2是对HTM代码停止转化的法式,包括在articlechar.inc外面
title=htmlencode2(request.form("txttitle"))
content=htmlencode2(request.form("txtcontent"))
typeid=request.form("typeid")
"翻开指定纪录集,并具有写的权限
set rs=server.createobject("adodb.recordset")
sql="select * from article where (articleid is null)"
rs.open sql,conn,1,3
"对指定纪录集停止增添,这里的addnew就是增添数据库内容的对象,假如没有addnew只要update那末就是对其停止更新
rs.addnew
rs("title")=title
rs("content")=content
rs("typeid")=typeid
rs("date")=date()
rs.update
articleid=rs("articleid")
"封闭翻开的纪录集和数据库毗连
rs.close
set rs=noting
conn.close
set conn=nothing
%>
<head>
</head>