📄 addsource2.asp
字号:
<!-- #include file=fenlei.inc -->
<%qian=request("qian")
if qian<>"13727952683933" then
response.write"成功了!"
response.end
end if%>
<HTML><head>
<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>
<link rel="stylesheet" type="text/css" href="../html/style.css"></head>
<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" background="1liv.jpg" vlink=0000ff bgcolor=ccbbaa>
<%
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
error=""
bt=trim(request.form("bt"))
oldbt=bt
if bt="" then
error=error&"请输入资源名称!<br>"
else
bt=replace(bt,"'","''")
end if
if strLength(oldbt)>100 then
error=error&"资源名称太长!<br>"
end if
url=trim(request("url"))
if strLength(url)>100 then
error=error&"资源地址太长!<br>"
end if
jiji=trim(request("jiji"))
if strLength(jiji)>200 then
error=error&"资源简介太长!<br>"
end if
choose=request("fenleiid")
response.write "choose:"&choose
if isNull(choose) or choose="" or isNumeric(choose)=0 then
error=error&"资源类型没有选择!<br>"
end if
choose=int(choose)
response.write "fenleinum:"&fenleinum
if choose>fenleinum or choose<1 then
error=error&"资源类型非法!<br>"
end if
if error<>"" then
response.write "<table border=0 align=center><tr><td><p><br>"&error&"</td></tr></table>"
response.end
end if
htmlflag=request.form("htmlflag")
photo=request("photo")
%>
<!-- #include file=../database.asp -->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select TOP 1 * from source where url='"&replace(url,"'","''")&"'"
rs.open sql,conn,1,3
if not rs.bof and not rs.eof then
response.write "<table border=0 align=center><tr><td><p><br>资源"&server.htmlencode(bt)&"已加入,不能再添加!</td></tr></table>"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
end if
rs.addnew
response.write "oldbt"&oldbt
rs("title")=oldbt
rs("jiji")=jiji
rs("fenleiid")=choose
rs("url")=request("url")
rs.Update
%>
<p><br><br>资源添加成功,添加的资源资料如下:<br>
资源标题:<%=server.htmlencode(rs("title"))%><br>
<%if rs("jiji")<>"" then
response.write server.htmlencode(rs("jiji"))&"<br>"
end if
response.write "加入时间:"&rs("ndatetime")
if rs("url")<>"" then response.write "资源地址:"&server.htmlencode(rs("url"))
response.write "</td></tr></table>"
rs.close
set rs=nothing
conn.close
set conn=nothing%>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -