⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_uppic2.asp

📁 南鄂电子商务学校网: 学校概况、校园动态、师资力量、教学成果、师生论坛、友情链接
💻 ASP
字号:
<!--#include file="config.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="format.asp"-->
<!--#include file="error.asp"-->
<!--#include file="body/incjs.asp"-->
<!--#include file="body/adminmenu.asp"-->
<!--#include file="body/adminuppic2_body.asp"-->
<!--#include file="body/foot.asp"-->
<%
dim founderr,errmsg
founderr=false
errmsg=""

if session("adminlogin")<>sessionvar then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你尚未登录,或者超时了!请<a href='login.asp'>重新登录</a>!"
  call diserror()
  response.end
else

if request.form("MM_insert") then

if request.Form("action")="newuppic" then

sql="select * from uppic"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim uppic_name,url
uppic_name=trim(replace(request.form("name"),"'",""))
url=trim(replace(request.form("url"),"'",""))

if uppic_name="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写图片名称!"
else
  rs("uppic_name")=uppic_name
end if
if url="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写图片地址!"
else
  rs("uppic_url")=url
end if

if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_uppic1.asp"
end if
end if

'edit
if request.Form("action")="edituppic" then
if request.Form("id")="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
  if not isInteger(request.form("id")) then
    founderr=true
    errmsg=errmsg+"<br>"+"<li>非法的图片id参数。"
  end if
end if
if founderr then
  call diserror()
  response.End
end if

sql="select * from uppic where uppic_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
uppic_name=trim(replace(request.form("name"),"'",""))
url=trim(replace(request.form("url"),"'",""))

if uppic_name="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写图片名称!"
else
  rs("uppic_name")=uppic_name
end if
if url="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写图片地址!"
else
  rs("uppic_url")=url
end if

if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_uppic1.asp"
end if
end if

'delete
if request.Form("action")="deluppic" then
if request.Form("id")="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
  if not isInteger(request.form("id")) then
    founderr=true
    errmsg=errmsg+"<br>"+"<li>非法的图片id参数。"
  end if
end if
if founderr then
  call diserror()
  response.End
end if

sql="select * from uppic where uppic_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
  rs.delete
  rs.close
  set rs=nothing
  response.redirect "admin_uppic1.asp"
end if

end if

call adminuppic2_body()
call endpage()
end if
%>

⌨️ 快捷键说明

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