📄 admin_picsave.asp
字号:
<!--#include file="function.asp"-->
<%CheckAdmin%>
<!--#include file="top.asp"-->
<% dim id,founderr,errmsg
founerr=false
if trim(request.form("classic"))<>"" or (trim(request.form("classid"))<>"" and trim(request.form("Nclassid"))<>"") then
founderr=false
classic=request.form("classic")
ConClassic=split(Classic,",")
classid=ConClassic(0)
Nclassid=ConClassic(1)
else
founderr=true
errmsg=errmsg+"<font color=red><li>请选择栏目</font></li>"
end if
if request.form("title")="" then
founderr=true
errmsg=errmsg+"<li>图片名不能为空</li>"
else
title=request.form("title")
end if
if request.form("Nkey")="" then
founderr=true
errmsg=errmsg+"<li>标题首拼音不能为空</li>"
else
Nkey=request.form("Nkey")
end if
if request.form("authorid")="" then
founderr=true
errmsg=errmsg+"<li>请选择作者</li>"
else
authorid=request.form("authorid")
end if
if request.form("images")="" then
founderr=true
errmsg=errmsg+"<li>图片地址不能为空</li>"
else
images=request.form("images")
end if
if request.form("sign")="" then
sign=""
else
sign=request.form("sign")
end if
if request.form("no")="" then
No=""
else
No=request.form("No")
end if
if request.form("size")="" then
ssize=""
else
ssize=request.form("size")
end if
if request.form("special")="" then
special=""
else
special=request.form("special")
end if
if request.form("key")="" then
key=""
else
key=request.form("key")
end if
if request.form("content")="" then
content=""
else
content=request.form("content")
end if
if request.form("creattime")<>"" then
creattime=request.form("creattime")
else
creattime=null
end if
if request.form("collecttime")<>"" then
collecttime=request.form("collecttime")
else
if request.form("collectyear")<>"" then collecttime=request.form("collectyear")+"年"
if request.form("collectmonth")<>"" then collecttime=collecttime+request.form("collectmonth")+"月"
if request.form("collectdate")<>"" then collecttime=collecttime+request.form("collectdate")+"日"
end if
best=request.form("best")
myself=request.form("myself")
text=request.form("text")
if founderr=true then
call error()
response.end
end if
if request("action")="add" then
call add()
if founderr<>true then call success()
elseif request("action")="edit" then
call edit()
if founderr<>true then call success()
else
founderr=true
errmsg=errmsg+"<li>没有选定参数</li>"
end if
sub add()
sql="select * from pic"
rs.open sql,conn,1,3
rs.addnew
rs("No")=No
rs("title")=title
rs("content")=content
rs("Nclassid")=Nclassid
rs("classid")=classid
rs("hits")=0
rs("images")=images
rs("best")=best
rs("myself")=myself
rs("Nkey")=Nkey
rs("key")=key
rs("size")=ssize
rs("special")=special
rs("creattime")=creattime
rs("collecttime")=collecttime
rs("sign")=sign
rs("authorid")=authorid
rs("updatetime")=date()
rs.update
id=rs("id")
rs.close
end sub
sub edit()
sql="select * from pic where id="&request("id")
rs.open sql,conn,1,3
rs("No")=No
rs("title")=title
rs("content")=content
rs("Nclassid")=Nclassid
rs("classid")=classid
rs("key")=key
rs("Nkey")=Nkey
rs("images")=images
rs("best")=best
rs("special")=special
rs("myself")=myself
rs("size")=ssize
rs("creattime")=creattime
rs("collecttime")=collecttime
rs("sign")=sign
rs("authorid")=authorid
rs.update
id=rs("id")
rs.close
end sub
sub success()
response.write "<table width=770 border=0 cellspacing=1 cellpadding=1 align=center bgcolor="&Tablebackcolor&">"&_
"<tr> "&_
"<td width=157 bgcolor="&Tabletitlecolor&">"&_
"</td>"&_
"<td width=609 bgcolor="&Tablebodycolor&"><div align=center><br><br>恭喜,图片"
if request("action")="add" then
response.write"添加"
else
response.write"修改"
end if
response.write"成功!<br><br>"&_
"<blockquote>图片序号为:"& id&"<br>图片标题为:"&title&"</blockquote>"&_
"<input type=button value=关 闭 onclick=javascript:self.close()> "&_
"<input type=button value=返 回 onclick=javascript:history.go(-1)>"&_
"</div>"&_
"</td>"&_
"</tr>"&_
"</table>"
end sub
if founderr=true then
call error()
end if
set rs=nothing
conn.close
set conn=nothing
%><!--#include file="copyright.asp"--></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -