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 that? Browsing other People's Web pages is too much advertising, slowing down the 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 ... But there is no way, but as far as I know, most of them are not enough clicks! Otherwise, you won't see the word "help, high-lift your mouse" on more than n 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;

  file://produces a random number between 1~how_many_ads.

if (ad==1) {

txt= "Free advertising from click2net!";

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

alt= "Click here to visit our sponsor";

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

Width= "468";

height= "60";

}

if (ad==2) {

txt= "Cornucopia Advertising network!";

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

alt= "Please click on our sponsor";

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

Width= "468";

height= "60";

}

if (ad==3) {

txt= "China Advertising Network";

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

alt= "China Advertising Network";

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

Width= "468";

height= "60";

}


file://needle to different random numbers, choose different ads

document.write ('

’);

document.write ('

document.write ('

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

document.write (' alt=\ ' + ALT + ' \ "border=0>

’);

document.write (' + txt + ');

document.write ('

’);

  file:// the ads

  file://to the right button pop-up advertising section, the best ... Delete

function Click () {

if (event.button==2) {

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

}

}

Document.onmousedown=click

end→

Haha, see understand? 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, using ASP's advertising rotation component is simpler. Here I will explain for you.

First, you must create a setup file that displays 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 number]

Adurl

Adhomepageurl

Text

Impressions


The redirect parameter represents the 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

BORDER 0

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

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

Click here to visit our sponsor

80

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

  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

China Advertising Network

20

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

<%

Response.Redirect Request ("url")

%>

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

<%

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

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

%>

Similarly, you can use the!—— #include file=ads.asp→ to insert, simplifying the subsequent modification work.

Guys, what do you think of my ad rotation Dafa? Do you want to revise your homepage at once? Hey, this is good, and save the net fee (see your homepage faster, save time on the Internet).



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.