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

📄 ad.asp

📁 庐江二中
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%
dim add,mixid,maxid
if request("add")<>"" then
add="AdAdd='"&request("add")&"' and "
else
add="AdAdd='' and "
end if
sql="Select * from ad where "&add&" checked=1"
rs.Open sql, conn, 1, 3
if rs.bof or rs.eof then
response.write "document.write('<div align=center>尚 无 广 告 图 片</div>');"
response.end
rs.close
else
rs.movefirst
minid=rs("id")
rs.movelast
maxid=rs("id")
rs.close

randomize
x=fix((maxid-minid+1)*rnd)+minid

sql = "Select * From ad where "&add&" id="&x&" and checked=1"
rs.Open sql,conn, 1,3

if rs.bof or rs.eof then
rs.close
sql="Select * From ad where "&add&" checked=1"
rs.Open sql,conn, 3,1
rs.movefirst
showad
else
showad
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing

sub showad
if rs("adwidth")<>0 then adwidth=" width="&rs("adwidth")
if rs("adheight")<>0 then adheight=" height="&rs("adheight")
if rs("isflash")=true then
response.write ("document.write('<embed src="""&rs("AdPic")&""" pluginspage=""http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"" type=""application/x-shockwave-flash"" " & adwidth & adheight &"></embed>');")
else
response.write ("document.write('<a href=""ShowAd.asp?ads=" & rs("id") & "&url=" & rs("AdUrl") & """ target=""_blank""><img border=0 src=""" & rs("AdPic") & """  alt=""" & rs("AdIntro") & """ " & adwidth & adheight &"></a>');")
response.end
end if
end sub
%>

⌨️ 快捷键说明

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