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

📄 savepic.asp

📁 一个漂亮的网络工作室源码 后台地址:/admin 用户名:admin 密码:admin888
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%
dim linkname,imgurl,linkurl
linkname=checkStr(request.Form("webname"))
linkurl=checkStr(request.Form("weburl"))
imgurl=checkStr(request.Form("imgurl"))
if linkname="" then
response.Write("<script>alert('网站名称不能为空!');history.back()</script>")
response.End()
end if
if linkurl="" then
response.Write("<script>alert('网站地址不能为空!');history.back()</script>")
response.End()
end if
if imgurl="" then
response.Write("<script>alert('网站地址不能为空!');history.back()</script>")
response.End()
end if

dim id
id=checkStr(request.Form("id"))
if id<>"" then
call modify()
else
call add()
end if

sub add()
conn.execute("insert into img (webname,imgurl,weburl) values('"&linkname&"','"&imgurl&"','"&linkurl&"')")
conn.close
set conn=nothing
response.Write("<script>alert('添加成功!');location='img.asp'</script>")
end sub

sub modify()
dim rs,lmufso,webid
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from img where id="&id,conn,1,3
if rs.bof or rs.eof then
response.Write("<script>alert('参数错误!');history.back()</script>")
response.End()
end if
'if imgurl<>"" then
'Set lmufso = Server.CreateObject("Scripting.FileSystemObject")
'if lmufso.fileExists(Server.MapPath(rs("imgurl"))) then
'lmufso.DeleteFile(Server.MapPath(rs("imgurl")))
'end if
'end if
rs("webname")=linkname
rs("weburl")=linkurl
rs("imgurl")=linkurl
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
response.Write("<script>alert('修改成功!');location='img.asp'</script>")
end sub
%>

⌨️ 快捷键说明

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