urladdok.asp

来自「一个查询某一个域名是否被注册的源代码 socket连接HTTP请求 网络编程」· ASP 代码 · 共 70 行

ASP
70
字号
<%@ LANGUAGE="VBSCRIPT" %>
<%option explicit%>
<%Dim wid,site,classid,url,about,show,showorder,hzhb,eer,rs,rsstr%>
<!--#include file="conn.asp"-->

<%
if session("admin")="" then
response.redirect "admin.asp"
end if

site=request("site")
classid=request("fenlei")
url=request("url")
about=request("about")
showorder=request("showorder")
show=request("show")
hzhb=request("hzhb")

if site="" then response.redirect "add.asp"
if classid="" then response.redirect "add.asp"
if url="" then response.redirect "add.asp"
'if showorder="" then response.redirect "add.asp"
if show="" then response.redirect "add.asp"
if hzhb="" then response.redirect "add.asp"

showorder=conn.execute("select count(*) from urls where classid="&classid)(0)+1

set rs=Server.CreateObject("ADODB.Recordset")
rsstr="select * from [urls]"
rs.open rsstr,conn,1,2

dim errr
errr=0
if rs.recordcount>0 then
	if rs("site")=site and rs("url")=url then errr=1
end if

if errr=1 then eer="请不要重复添加,<br/>正在返回添加首页!<br/>"
if errr<>1 then
rs.addnew
if site<>"" then rs("site")=site
if url<>"" then rs("url")=url
if about<>"" then rs("about")=about
if classid<>"" then rs("classid")=classid
if showorder<>"" then rs("showorder")=showorder
if show<>"" then rs("show")=show
if hzhb<>"" then rs("hzhb")=hzhb
rs("check")=1
rs.update

rs.close
set rs=Nothing
conn.close
set conn=nothing
end if
%>
<html>
<head>
<title>添加成功</title>
<meta http-equiv="refresh" content='2; URL=urladd.asp'>
</head>
<body>
<p align="center">
<%if eer="" then%>
<b>网址添加成功!</b>
<%else%>
<b><%=eer%></b>
<%end if%></p>
</body>
</html>

⌨️ 快捷键说明

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