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

📄 editlink2.asp

📁 中国114网搜索系统 版  本: 文件大小:580 KB 软件语言:简体中文 授权方式:免费版 相关链接:程序演示 开 发 商: 运行环境:ASP源码
💻 ASP
字号:
<%@ LANGUAGE = VBScript%>
<%
id=1
%>
<!-- #include file=../database.asp -->
<%
Set rs = Server.CreateObject("ADODB.Recordset")

function CheckPassword()
	sql="select * from ourusers where Ltrim(Rtrim(username))='supervisor'"
	rs.open sql,conn,1,1
	if not rs.eof then
  		if trim(rs("pass"))<>session("pass") then
    			response.write "<br>错误的密码!"
    			rs.close
    			set rs=nothing
			conn.close
			set conn=nothing
    			response.end
  		else
    			rs.close
  		end if
	else
  		response.write "错误:用户不存在!"
  		rs.close
  		set rs=nothing
		conn.close
		set conn=nothing
  		response.end
	end if
end function

checkPassword()
%>
<!-- Design and Edit By QianFengyun 2000-5-20 -->
<!-- #include file=../change.asp -->
<!-- #include file=../fenlei/makehtmfile.asp -->
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0041)http://www.china114net.com 中国114网 -->
<html>
<head>
<title><%=titlename%></title>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<link rel="stylesheet" type="text/css" href="../html/style.css">
</head>
<%
function strLength(str)
	dim WINNT_CHINESE
	WINNT_CHINESE=(len("例子")=2)
	if WINNT_CHINESE then
		dim l,t,c
		dim i
		l=len(str)
		t=l
		for i=1 to l
			c=asc(mid(str,i,1))
			if c<0 then c=c+65536
			if c>255 then
				t=t+1
			end if
		next
		strLength=t
	else 
		strLength=len(str)
	end if
end function

username=trim(request("username"))
if strLength(username)>10 or username="" then
	response.write "没有输入用户名或用户名太长!最多10个字符."
	conn.close
	set conn=nothing
	response.end
end if

sitename=trim(request("sitename"))
if strLength(sitename)>40 or sitename="" then
	response.write "没有输入网站名称或网站名称太长!最多40个字符."
	conn.close
	set conn=nothing
	response.end
end if
url     =trim(request("url"))
if strLength(url)>100 or url="" then
	response.write "没有输入网站地址或网站地址太长!最多100个字符."
	conn.close
	set conn=nothing
	response.end
end if
jiji    =trim(request("jiji"))
if strLength(jiji)>200 then
	response.write "网站简介太长!最多200个字符."
	conn.close
	set conn=nothing
	response.end
end if

fid=request("fenleiid")
if isNumeric(fid)=0 or fid="" then 
  	response.write "没有这个分类!"
	conn.close
	set conn=nothing
  	response.end
end if
fid=int(fid)
if fid<0 then
  	response.write "没有这个分类!"
  	rs.close
  	set rs=nothing
	conn.close
	set conn=nothing
  	response.end
end if

id=request("id")
if isNumeric(id)=0 or id="" then 
  	response.write "没有这个记录!"
	conn.close
	set conn=nothing
  	response.end
end if
id=int(id)
if id<0 then
  	response.write "没有这个记录!!"
  	rs.close
  	set rs=nothing
	conn.close
	set conn=nothing
  	response.end
end if

Set rs = Server.CreateObject("ADODB.Recordset")

sql    = "select * from ourusers where username='"&replace(username,"'","''")&"'"
rs.open sql,conn,1,1
if rs.eof or rs.bof then
	response.write "用户名错误!"
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	response.end
end if

rs.close

sql    = "select * from fenlei where id="&fid
rs.open sql,conn,1,1

response.write "id:"&id
if rs.eof or rs.bof then
  	response.write "填入的<font color=ff0000>分类</font>错误!没有这个分类!可能是此分类不存在或已被删除."
  	rs.close
  	set rs=nothing
	conn.close
	set conn=nothing
  	response.end
else
	fenleiid=rs("id")
	fatherid=rs("father")
end if

expediency=rs("expediency")

tempStr="总分类 "

for i=1 to expediency
	tempStr=tempStr & " &gt; <a href=addfenlei.asp?id="&id&"&fid="&rs(10+i)&">"&trim(rs(i))&"</a>"
next

rs.close

do while right(url,1)="/" or right(url,1)="\"
	url=left(url,len(url)-1)
loop

sql    = "select * from linking where url='"&replace(url,"'","''")&"' and id<>"&id
rs.open sql,conn,1,3

if not rs.eof then
	response.write "无法修改为此网址,因为这个网址有人用了!!"
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	response.end
end if

rs.close


sql    = "select * from linking where id="&id
rs.open sql,conn,1,3
if rs.eof then
	response.write "无法修改此网址,因为这个网址不存在!!"
	rs.close
	set rs=nothing
	conn.close
	set conn=nothing
	response.end
end if
oldfenleiid=rs("fenleiid")
rs("username")=username
rs("sitename")=sitename
rs("url")     =url
rs("jiji")    =jiji
rs("fenleiid")=fenleiid
rs.Update
rs.close
set rs=nothing
%>
<BODY vlink=0000ff leftmargin="10" topmargin="10" marginwidth="0" marginheight="0"  bgcolor=ccbbaa>
<%

conn.Execute "UPDATE fenlei " _

        & "SET num = num+1 " _

        & "WHERE id ="&fenleiid
        
conn.Execute "UPDATE fenlei " _

        & "SET num = num-1 " _

        & "WHERE id ="&oldfenleiid
        
response.write "<br>修改成功!!新资料如下:<br>网站名称:"&server.htmlencode(sitename)&"<br>网站地址:"&server.htmlencode(url)&"<br>网站简介:"&server.htmlencode(jiji)&"<br>所在分类:"&tempStr&"<br>"

response.write "<br>现在正在更新加入的分类的html代码页........."

response.write "fid:"&fid
response.write "fenleiid:"&fenleiid
if writeFenleiFiles(getfenleidirecttrue(fenleiid),fenleiid)=0 then
	response.write "<br>建立分类HTM文件失败!"
else
	response.write "<br>建立分类HTM文件成功!"
end if

response.write "fatherid:"&fatherid
response.write "<br>现在正在更新加入的分类的上一级分类的html代码页........."

		if int(fatherid)=0 then
			response.write "<br>正在建总分类......<br>"
			strFenleiDirect=server.mapPath(dirstring&"navigate/")
			response.write strFenleiDirect
			if writeFenleiFiles(strFenleiDirect,0)=0 then
				response.write "<br>建立分类HTM文件失败!"
			else
				response.write "<br>建立分类HTM文件成功!"
			end if
		else
			if writeFenleiFiles(getfenleidirecttrue(fatherid),fatherid)=0 then
				response.write "<br>建立分类HTM文件失败!"
			else
				response.write "<br>建立分类HTM文件成功!"
			end if
		end if

conn.close
set conn=nothing
%>
</body>
</html>

⌨️ 快捷键说明

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