admin_news.asp

来自「ASPSQL企业网络管理系统」· ASP 代码 · 共 50 行

ASP
50
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../include/config.asp" -->
<!--#include file="../include/check_session.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../style/style.css" rel="stylesheet" type="text/css">
<title>发布新闻</title>
</head>
<body>
<%
dim id,obj,ss,aa
Set obj = Server.CreateObject("LyfUpload.UploadFile")
if not IsObject(obj) then
	Response.Write "LyfUpload control not installed !"
	Response.End
end if
aa=obj.filetype("newspic") 
if aa <> "" then
	ss=obj.SaveFiletodb("newspic") 
else
	ss = "no pic uploaded!"
end if
if ss= "" then
	Response.Write "<center>图片上传失败!<br><br><a href='history.back()'>返 回</a></center>"
else
	with session("rs")
		.Open "news",session("conn"),adOpenDynamic,adLockOptimistic,adCmdTableDirect
		if obj.Request("action") = "insert" then
			.AddNew
		else 
			if obj.Request("action") = "edit" then
				.find "id = " & obj.Request("id") 
			end if
		end if
			.Fields("title") = obj.Request("title")
			.Fields("content") = obj.Request("content")
			.Fields("type_id") = obj.Request("type")
			.Fields("pic_type") = aa
			if ss <> "no pic uploaded!" then
				.Fields("pic").AppendChunk obj.DBContent
			end if
		.Update
	end with
	Response.Redirect("insert_news.asp")
end if
%>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?