|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
因为现在数据库都使用标准的SQL语言对数据库进行管理,所以如果是标准SQL语言,两者基本上都可以通用的。SQLServer还有更多的扩展,可以用存储过程,数据库大小无极限限制。fso
<!--#includefile="config.asp"-->
<!--#includefile="inc/articlechar.inc"-->
<%
functionchangechr(str)
changechr=replace(replace(replace(replace(changechr,"[pic]","<imgsrc="),"","<b>"),"[red]","<fontcolor=CC0000>"),"[big]","<fontsize=7>")
changechr=replace(replace(replace(replace(changechr,"[/pic]","></img>"),"","</b>"),"[/red]","</font>"),"[/big]","</font>")
changechr=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13),"<br>"),"","")
endfunction
%>
<%
ifrequest.cookies("newsadminok")=""then
response.redirect"login.asp"
endif
ifrequest.form("txttitle")=""then
response.write"毛病提醒:请输出旧事题目!"
response.end
endif
ifrequest.form("txtcontent")=""then
response.write"毛病提醒:请未输出旧事内容!"
response.end
endif
dimtitle
dimcontent
dimsql
dimrs
dimarticleid
dimclassid,Nclassid
dimfrom
title=htmlencode2(request.form("txttitle"))
from=request.form("Nfrom")
zznews=request.form("zznews")
typeid=request.form("typeid")
about=request.form("about")
headline=request.form("headline")
ftitle=htmlencode2(request.form("ftitle"))
dimsql1
dimrs1
dimtypename
sql1="select*fromtypewheretypeid="&typeid
setrs1=server.createobject("adodb.recordset")
rs1.opensql1,conn,1,1
typename=rs1("type")
ifrequest.form("checkbox1")="1"then
tjnews=1
else
tjnews=2
endif
ifrequest.form("yheadline")="1"then
yheadline=1
else
yheadline=0
endif
content=htmlencode(request.form("txtcontent"))
setrs=server.CreateObject("ADODB.RecordSet")
StrSql="selectE_MemofromExample"
setrs=conn.Execute(StrSql)
fname=makefilename(now())
dddd=year(now())&"年"&month(now())&"月"&day(now())&"日"&hour(now())&":"&minute(now())
pencat=rs("E_Memo")
pencat=replace(pencat,"lx",typename)
pencat=replace(pencat,"Date",dddd)
iffrom=""then
pencat=replace(pencat,"From","")
else
pencat=replace(pencat,"From","摘自:"&from)
endif
ifzznews=""then
pencat=replace(pencat,"Fname",Editor)
zznews=Editor
else
pencat=replace(pencat,"Fname",zznews)
endif
pencat=replace(pencat,"H_Title",title)
pencat=replace(pencat,"H_Memo",content)
pencat=replace(pencat,"labout",about)
pencat=replace(pencat,"ftitle",ftitle)
newsdate=year(now())&"."&month(now())&"."&day(now())
TimePath=year(Now())&"-"&month(now())&"-"&day(Now())
FolderPath=Server.MapPath(".")&""&TimePath
rs.close
将旧事保留进数据库
sql="select*fromarticlewhere(newsidisnull)"
rs.opensql,conn,1,3
rs.addnew
rs("title")=title
rs("content")=content
rs("Nfrom")=from
rs("typeid")=typeid
rs("path")=TimePath
rs("typename")=typename
rs("tjnews")=tjnews
rs("N_Fname")=fname
rs("zznews")=zznews
rs("about")=about
rs("newsdate")=newsdate
rs("yheadline")=yheadline
rs("headline")=headline
ifftitle""thenrs("ftitle")=ftitle
rs.update
pencat=replace(pencat,"h_id",rs("newsid"))
Setfso=Server.CreateObject("Scripting.FileSystemObject")
IfCheckDir(FolderPath)=TrueThen
Setfout=fso.CreateTextFile(FolderPath&""&fname)
Else
MakeNewsDirTimePath
Setfout=fso.CreateTextFile(FolderPath&""&fname)
Endif
fout.WriteLinepencat
fout.close
articleid=rs("newsid")
UpdateJs(news)
rs1.close
setrs1=nothing
rs.close
setrs=nothing
conn.close
setconn=nothing
response.redirect"addnews.asp"
%>
缺点:正版成本价格贵(盗版就不说了)、不够安全,大多数服务器用windows系统,没有linux安全 |
|