Homepage ad rotation Dafa in ASP

Source: Internet
Author: User

Now you are on the home page is not advertising flying all over the sky? Are you worried about this? Browsing other people's Web site too much advertising, slow speed. Do their own web page and unwilling to delete a few ads, after all, that is the theoretical money ah, hehe. Contradiction Ah, one side is to ask for fast speed to get netizens, while the demand for more advertising to obtain money, although this money is very vague, but ... People are always a little bit greedy. You prawns, how do you solve it?

You should be more familiar with JavaScript. Here we use it to solve the problem of advertising. Design idea is this: the original same screen display multiple fixed advertising practice to Single-screen only show an ad, but this advertisement is rotation, that is, each time you browse, the ads appear different. In this way, the speed is fast, and the number of clicks does not drop (because most ads are counted only once for multiple clicks of the same IP). Hey, this method is not very good ah? (Next: But this seems to show that the number will be reduced AH!) This...... There is no way, but as far as I know, most of the clicks are not enough ah! Otherwise, you will not see the words "help, high-lift your mouse" on n multiple home pages.

Below is the source code. If you are a law-abiding citizen, you can delete the last Right key pop-up window code section, because ... This is after all a suspicion of cheating. In fact, changes in the section code can be used for many purposes, such as the right to click Random Navigation, greetings and so on. I am here to make a start, you prawns to do their own change it!


var how_many_ads = 3;

var now = new Date ()

var sec = Now.getseconds ()

var ad = sec% How_many_ads;

Ad +=1;

//produces a random number between 1~how_many_ads  

if (ad==1) { 

txt= "free advertising from click2net!"; &NBSP

url= "http://redirect.click2net.com/?" A044837,88 ";  

alt=" Click here to visit our sponsor ";  

banner= http://image.click2net.com/? A044837,88 ";  

Width=" 468 ";  

height=;  



if (ad==2) { < br>
txt= "cornucopia advertising network!"; &NBSP

Url= "http://cashbox.com.cn/Ads/click.html?clientID=1004321";  

alt= "Please click our sponsor"; 

banner= "http://cashbox.com.cn/Ads/ads.html?clientID=1004321";  

Width= "468";  

Height= " ";



if (ad==3) { 

txt= "China ad network";  

url= "http://" www.chinaads.net/ads/clicks.asp?100188,1 "&NBSP;

alt=" Chinese advertising network ";  

banner= http:// www.chinaads.net/ads/images.asp?100188,1 ";  

width=" 468 ";  

height=;  

}

//For different random numbers, select different ad  

document.write ('  

');  

document.write ('  

document.write ('  

document.write (width + ' height= ' + height + ');  

document.write (' Alt = "' + Alt + '" BORDER=0>&NBSP;

');  

document.write (' + txt + ');  

document.write ('  

');  

//Output ad  

//Below is the right key pop-up ad section, preferably ... Delete  

Function Click () { 

if (event.button==2) { 

window.open (URL, ' popwindows ', " toolbar=no,menubar=no,width=200,height=200 ")  





document.onmousedown= CLICK&NBSP

end→ 

Haha, you see? I'm saving it as a ads.js file and inserting it in the Web page, so it's convenient to change ads later.

Now support ASP's home page space is also more and more, if you have such a homepage, the use of ASP's advertising rotation component is simpler. Here I will explain for you. &NBSP

First, you must establish a settings file to display the way. This is a text file that records how graphics are displayed and other settings information. The format is as follows:  

[REDIRECT url] 

[WIDTH number] 

[HEIGHT number] 

[BORDER N UMBER]&NBSP



adurl 

adhomepageurl 

text 

Impressions

The

Redirect parameter represents the Web page file that the viewer is responsible for when clicking on the advertisement picture. Width,height,border is the parameters related to the picture, you should see it. * Below is the specific ads, you can set up more than one group. Adurl represents the location where the advertisement picture is stored. Adhomepageurl represents the address that the image links to, which is where The Advertiser wants you to go. Text corresponds to the ALT attribute of the label in the HTML language. Impressions is the basis for random display of pictures, the value between 0 to 4294967295, the advertising component based on it to randomly display pictures. Here's an example of how I rewrote the above ad:  

REDIRECT click.asp 

WIDTH 468 

HEIGHT 60 

BOR DER 0 



http://image.click2net.com/? A044837,88&NBSP

http://redirect.click2net.com/? A044837,88&NBSP

Click here to visit our sponsor 

80 

Http://cashbox.com.cn/Ads/ads. HTML?CLIENTID=1004321&NBSP

http://cashbox.com.cn/Ads/click.html?clientID=1004321 

Please click on our sponsor  

40 

http://www.chinaads.net/ads/images.asp?100188,1 

http:// WWW.CHINAADS.NET/ADS/CLICKS.ASP?100188,1&NBSP

Chinese advertising network  

Save it as a ad.txt and then write click.asp, which is simpler, one sentence:  

<% 

Response.Redirect Request ("url")  

%> 

Finally, you need to write a program to build the component ads.asp. is also simple:  

<% 

Set ad=server.createobject ("MSWC. ADRotator ")  

Response.Write AD. GetAdvertisement ("Ad.txt")  

%> 

Similarly, you can also use the!—— #include file=ads.asp→ to insert, simplifying future modifications.

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.