Advertising | site culture you use ASP in 5 minutes to create a site pop-up ads
Here we only give the core code, display and background add is quite simple, you can completely handle yourself.
First you insert the following code into the code of the first page of the website
<% ' pop-up ad settings--code by Ceocio
sql = "SELECT top 2 width,height,id from POPs where useit=1 order by id"
Set Rs=conn.execute (SQL)
If not rs.eof and not Rs.bof then
Do as not rs.eof
ID=RS ("id")
Width=rs ("width")
Height=rs ("height")
Windownum=windownum+1
%>
<script language= "JavaScript" >
var windownum=<%=windownum%>
var id=<%=id%>;
var height=<%=height%>
var width=<%=width%>
<!--
window.open (' pop.asp?id= ' +id, ' NewWindow ' +windownum,
' height= ' +height+ ', width= ' +width+ ', Top=0,left=0,toolbar=no,menubar=no,scrollbar
S=yes,resizable=no,location=no,status=no ')
-->
</SCRIPT>
<%
Rs.movenext
Loop
Rs.close
End If%>
This example only sets the maximum activation of two ads, depending on the need you can set more, but not much is not good, slow.
Create a new database, build a table: Pop
The contents of the Pop table field are as follows:
ID Auto Number
Width pop-up window number type
Height pop-up window high number type
Content Memo Type
Useit Active, yes/No
Receive the passed parameter in the pop.asp to open the corresponding record to show it.
OK, now that your pop-up ad system is complete. Is it simple?