"插入數(shù)據(jù)庫(kù)連接文件 <!--#include file="conn.asp"--> "插入解釋HTM代碼文件,下一節(jié)將為大家介紹,主要是對(duì)HTM代碼進(jìn)行轉(zhuǎn)化,以免出現(xiàn)頁(yè)面格式上的混亂,而且也更方便對(duì)技術(shù)性文章的發(fā)表 <!--#include file="articlechar.inc"--> "如果不是從管理頁(yè)面進(jìn)入,則轉(zhuǎn)到驗(yàn)證管理員信息頁(yè)面 <% 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處返回的文章內(nèi)容信息,這里的htmlencode2是對(duì)HTM代碼進(jìn)行轉(zhuǎn)化的程序,包含在articlechar.inc里面 title=htmlencode2(request.form("txttitle")) content=htmlencode2(request.form("txtcontent")) typeid=request.form("typeid") "打開(kāi)指定記錄集,并具有寫(xiě)的權(quán)限 set rs=server.createobject("adodb.recordset") sql="select * from article where (articleid is null)" rs.open sql,conn,1,3 "對(duì)指定記錄集進(jìn)行增加,這里的addnew就是增加數(shù)據(jù)庫(kù)內(nèi)容的對(duì)象,如果沒(méi)有addnew只有update那么就是對(duì)其進(jìn)行更新 rs.addnew rs("title")=title rs("content")=content rs("typeid")=typeid rs("date")=date() rs.update articleid=rs("articleid") "關(guān)閉打開(kāi)的記錄集和數(shù)據(jù)庫(kù)連接 rs.close set rs=noting conn.close set conn=nothing %> <head> </head>