ASP to create a site pop-up ads

Source: Internet
Author: User
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?



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.