save_index_left.asp

来自「个人网站模板」· ASP 代码 · 共 79 行

ASP
79
字号
<!--#include file="conn_admin.asp" -->
<!--#include file="check_admin.asp"-->
<!--#include file="info.asp" -->
<script src="ubbcode.js"></script>
<%
if Request.QueryString("cz")="" then
Response.Redirect"info.asp?info=错误的参数"
else
cz=Request.QueryString("cz")
end if

if cz="del" then

conn.execute "delete from index_left where id="&Request.QueryString("id")
Response.Redirect"index_left.asp"

else

REM ------判断数据有效性------

founderr=false
if trim(Request.Form("pic_name"))="" then
founderr=true
info=info+"<li>请填写图片的名称</li>"
end if
if trim(Request.Form("smallimg"))="" then
founderr=true
info=info+"<li>请填写图片的名称</li>"
end if

REM ------如果数据是有效的则开始存储数据并显示相关信息------

if founderr=false then 
set rs=server.createobject("adodb.recordset")
if cz="addfile" then
sql="select * from index_left where (id is null)" 
rs.open sql,conn,1,3
rs.addnew
else
sql="select * from index_left where id="&Request.QueryString("id") 
rs.open sql,conn,1,3
rs("listid")=Request.Form("listid")
end if
rs("pic_name")=Request.Form("pic_name")
if Request.Form("smallimg")="" then
rs("smallimg")="images/nominipic.gif"
else
rs("smallimg")=Request.Form("smallimg")
end if
if Request.Form("pic_url")<>"" then
rs("pic_url")=Request.Form("pic_url")
else
rs("pic_url")="admin/"&Request.Form("smallimg")
end if
rs.update
rs.close
set rs=nothing
conn.close
Set conn=Nothing
if cz="addfile" then
Response.Redirect"index_left.asp"
else
Response.Redirect"index_left.asp"
end if

REM ------如果数据是无效的则开始显示错误信息------

else
call infom()
end if
end if

function HTMLEncode2(fString)
	fString = Replace(fString, CHR(13), "")
	fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
	fString = Replace(fString, CHR(10), "<BR>")
	HTMLEncode2 = fString
end function
%>

⌨️ 快捷键说明

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