Creating Your Own Ad Server

These days, it’s rare to find a Web site that doesn’t have advertisements. Generally, ads on a Web site are provided by an ad server. The way ad servers work varies, but basically their job is to display ads to each user, and to make sure that all of the ads available get shown the proper number of times. In the example in this chapter, the ad server will just display an ad at random each time the script is called.

Most ad servers are more complex, because the advertisers buy a certain number of advertisements and the ad server has to manage each ad purchaser’s contractual obligations. They are also generally integrated with the Web publishing system so that the ads can insert some text in the page, including a link ...

Get Sams Teach Yourself CGI in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.