📄 joinnow.asp
字号:
<%@ LANGUAGE = VBScript%>
<%Server.ScriptTimeout=5000%>
<%
id=1
if isObject(conn)=0 then%>
<!-- #include file=../database.asp -->
<%
end if
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
response.end
else
rs.close
end if
else
response.write "错误:用户不存在!"
rs.close
set rs=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
sitename=trim(request("sitename"))
if strLength(sitename)>40 or sitename="" then
response.write "没有输入网站名称或网站名称太长!最多40个字符."
response.end
end if
url =Lcase(trim(request("url")))
if strLength(url)>100 or url="" then
response.write "没有输入网站地址或网站地址太长!最多100个字符."
response.end
end if
if left(url,7)<>"http://" then
response.write "URL非法!请用http://开头.而且全是小写!"
response.end
end if
jiji =trim(request("jiji"))
if strLength(jiji)>200 then
response.write "网站简介太长!最多200个字符."
response.end
end if
fid=request("fid")
if isNumeric(fid)=0 or fid="" then
response.write "没有这个分类!进入添加一级分级"
response.end
end if
fid=int(fid)
if fid<0 then
response.write "没有这个分类!"
response.end
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "select * from fenlei where id="&fid
rs.open sql,conn,1,1
if rs.eof or rs.bof then
response.write "没有这个分类!"
rs.close
set rs=nothing
response.end
else
fenleiid=rs("id")
fatherid=rs("father")
end if
expediency=rs("expediency")
tempStr="总分类 "
for i=1 to expediency
tempStr=tempStr & " > <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,"'","''")&"'"
rs.open sql,conn,1,1
if not rs.eof then
response.write "网址已经存在,不用再添加了!!此网站已经加在<a href=../navigate.asp?fid="&rs("fenleiid")&">此分类</a>里了."
rs.close
set rs=nothing
response.end
end if
rs.close
set rs=nothing
conn.Execute " INSERT INTO linking " _
& "(username,sitename,url,jiji,fenleiid,fen,ndatetime) VALUES " _
& "('supervisor','"&replace(sitename,"'","''")&"','"&replace(url,"'","''")&"','"&replace(jiji,"'","''")&"',"&fenleiid&",0,'"&date()&"');"
response.write date()
response.write sql
%>
<BODY vlink=0000ff leftmargin="0" topmargin="10" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">
<%
conn.Execute "UPDATE fenlei " _
& "SET num = num+1 " _
& "WHERE id ="&fid
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
if writeFenleiFiles(getfenleidirecttrue(fid),fid)=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
%>
<script>this.location="chooseassort.asp?fid=<%=fid%>";</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -