addnews.asp
来自「毕业设计_新闻管理系统(ASP)+论文.rar(1.32M)」· ASP 代码 · 共 43 行
ASP
43 行
<%@ LANGUAGE="VBSCRIPT"%>
<%
function fixQuotes(theString)
fixQuotes=Replace(theString,"'","''")
end function
set conn=server.createObject("ADODB.Connection")
dbpath=server.mappath("news.mdb")
conn.open "driver={Microsoft Access Driver (*.mdb)};dbq="&dbpath
'set rs=server.createobject("adodb.recordset")
strSql="INSERT into news (classfication,title,accessory,imagesname,key1,key2,reporter,lookfrom,newsdate,content) VALUES('"+fixquotes(server.htmlencode(request.form("leibie")))+"','"+fixquotes(server.htmlencode(Request.Form("biaoti")))
strSql=strSql+"','"+fixQuotes(server.htmlencode(TRIM(Request.Form("fubiaoti"))))+"','"+"imagesname"
strSql=strSql+"','"+fixQuotes(server.htmlencode(TRIM(Request.Form("gjz1"))))
strSql=strSql+"','"+fixQuotes(server.htmlencode(TRIM(Request.Form("gjz2"))))
strSql=strSql+"','"+fixQuotes(server.htmlencode(TRIM(Request.Form("zuozhe"))))
strSql=strSql+"','"+fixQuotes(server.htmlencode(TRIM(Request.Form("zhaizi"))))
strSql=strSql+"',Now()"
strSql=strSql+",'"+replace(fixQuotes(server.htmlencode(trim(Request.Form("neirong")))),vbcrlf,"<br> ")+"')"
insertnum=0
response.write "<br>"
'response.end
Set rs=conn.Execute(strSql)
%>
<script language=javascript>
<!--
alert("提交成功!");
window.location.href="ad.asp";
//-->
</script>
<html>
<head>
<title>新闻提交</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="#FFFFFF">
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?