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

📄 web_ok.asp

📁 这《ASP网络编程从入门到精通》书中的全部源程序
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
dim rs,id,sort,sort_path,sort_id,keyword,name,email,oicq,address,postcode

set rs=server.createobject("adodb.recordset")
rs.open "select id,sort,sort_id from sort where id="&request.form("sort_id"),conn,1,1
if rs.eof and rs.bof then
'
else
iid=rs("id")
ssort=rs("sort")
ssort_id=rs("sort_id")
end if
rs.close
set rs = nothing

path_id="/"&iid&"/"
path=" >> "&ssort
if sort_id<>0 then
for i=1 to 8 step 1
set rs=conn.execute("select id,sort,sort_id from sort where id="&ssort_id)
if rs.eof and rs.bof then
'
else
ssort_id=rs("sort_id")
path_id="/"&rs("id")&""& path_id
path=" >> "&rs("sort")&"" & path
end if
rs.close
set rs = nothing
next
end if

select case request("action")
case "add"
keyword=request.form("keyword")
set rs=server.createobject("adodb.recordset")
rs.open "select * from web where id is null",conn,1,3
rs.addnew
rs("sort")=path
rs("sort_path")=path_id
rs("sort_id")=request.form("sort_id")
rs("title")=request.form("title")
rs("url")=request.form("url")

if keyword="" then
rs("keyword")=null
else
rs("keyword")=keyword
end if

rs("content")=request.form("content")
rs("verify")="0"
rs("click")="0"
rs("time")=date()
rs.update
rs.close
set rs = nothing
response.write "<Script>window.alert('网站添加成功');location.replace('add.asp?sort_id="&request.form("sort_id")&"');</Script>"

case "edit"
id=request.form("id")
keyword=request.form("keyword")
name=request.form("name")
email=request.form("email")
oicq=request.form("oicq")
address=request.form("address")
postcode=request.form("postcode")

set rs=server.createobject("adodb.recordset")
rs.open "select * from web where id="&id,conn,1,3
rs("sort")=path
rs("sort_path")=path_id
rs("sort_id")=request.form("sort_id")
rs("title")=request.form("title")
rs("url")=request.form("url")

if keyword="" then
rs("keyword")=null
else
rs("keyword")=keyword
end if

rs("content")=request.form("content")

if name="" then
rs("name")=null
else
rs("name")=name
end if

if email="" then
rs("email")=null
else
rs("email")=email
end if

if oicq="" then
rs("oicq")=null
else
rs("oicq")=oicq
end if

if address="" then
rs("address")=null
else
rs("address")=address
end if

if postcode="" then
rs("postcode")=null
else
rs("postcode")=postcode
end if
rs("verify")=request.form("verify")
rs.update
rs.close
set rs=nothing
response.write "<Script>window.alert('网站登录信息修改成功');window.close();</Script>"

end select
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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