?? editjoin2.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 -->
<!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個字符."
set rs=nothing
conn.close
set conn=nothing
response.end
end if
sitename=trim(request("sitename"))
if strLength(sitename)>40 or sitename="" then
response.write "沒有輸入網站名稱或網站名稱太長!最多40個字符."
set rs=nothing
conn.close
set conn=nothing
response.end
end if
url =trim(request("url"))
if strLength(url)>100 or url="" then
response.write "沒有輸入網站地址或網站地址太長!最多100個字符."
set rs=nothing
conn.close
set conn=nothing
response.end
end if
jiji =trim(request("jiji"))
if strLength(jiji)>200 then
response.write "網站簡介太長!最多200個字符."
set rs=nothing
conn.close
set conn=nothing
response.end
end if
fid=request("fenleiid")
if isNumeric(fid)=0 or fid="" then
response.write "沒有這個分類!"
set rs=nothing
conn.close
set conn=nothing
response.end
end if
fid=int(fid)
if fid<0 then
response.write "沒有這個分類!"
set rs=nothing
conn.close
set conn=nothing
response.end
end if
id=request("id")
if isNumeric(id)=0 or id="" then
response.write "沒有這個記錄!"
set rs=nothing
conn.close
set conn=nothing
response.end
end if
id=int(id)
if id<0 then
response.write "沒有這個記錄!!"
set rs=nothing
conn.close
set conn=nothing
response.end
end if
if isObject(conn)=0 then%>
<!-- #include file=../database.asp -->
<%
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
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")
end if
expediency=rs("expediency")
tempStr="總分類 "
for i=1 to expediency
tempStr=tempStr & " > <a href=../fenlei/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?id="&rs("fenleiid")&">此分類</a>里了."
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
end if
rs.close
sql = "select * from templink 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
rs("username")=username
rs("sitename")=sitename
rs("url") =url
rs("jiji") =jiji
rs("fenleiid")=fenleiid
rs.Update
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<BODY vlink=0000ff leftmargin="10" topmargin="10" marginwidth="0" marginheight="0" bgcolor="#FFFFFF">
<%
response.write "<br>修改成功!!新資料如下:<br>網站名稱:"&server.htmlencode(sitename)&"<br>網站地址:"&server.htmlencode(url)&"<br>網站簡介:"&server.htmlencode(jiji)&"<br>所在分類:"&tempStr&"<br>"
%>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -