"The age of the banner ad is dead" shouts a self-proclaimed online marketer. "Banner ads represent a bad return on investment" writes another. The truth of the matter is that banner ad's aren't dead, my friend. In this article Tim shows us how to create a banner management application that lets us add nifty MySQL-blobbed, two part drop-down banners to our sites. If you run your own site then you can't afford not to read this tutorial!
Make Your Own Cool Drop Down Ad's - How drop down ads work (Page 2 of 7 )
Before I discuss the database or PHP code for this article, let's take a quick look at how drop down ads actually work, so you know what I'm talking about. Let's assume that we have the following 430x50 banner on our web site:
That banner's good, but what about if we could really grab our visitor's attention and provide them with more information about tomatoes, and also let them request a free taste sampling at the same time? Consider the second part of this banner, which is shown below:
In the image above, I've added the grey dotted line simply to show how the banners will appear. The [ Expand ] link above the banners can be used to toggle whether or not the bottom part of the banner is shown. As mentioned earlier, when the page loads, the bottom banner will be displayed for a couple of seconds and will then collapse, leaving only the top part of the banner visible, like this:
Now, hopefully I haven't confused you too much and we can continue onto building the database that will hold the images and the details of each ad.
Building the database To keep things simple, we will build a database that has just one table. Start by creating a database called ads at the MySQL console application:
create database ads; use ads;
Next we want to create a table that will store the details of each ad, as well as the top and bottom part of the banner, as blobs. Call the table banners: