HOW: Rotating Banners On Webpage w/o JS or CGI

I was on this webpage:

And they have a banner at the top/bottom of their webpage.  Everytime I load this page (I access the webpage and see a banner, then, close Netscape and access the webpage again -- I do not hit reload) it shows a new banner.  How do they do this without Javascript and a CGI script?  The banner is cached as well and so you'd think that when I go to access the page again (without reloading) it would fetch everything from cache!  Could SSI be involved even though the webpage doesn't have the extension .SHTML?

This is exactly what I want to do but I could only figure out doing such a trick with a call to a CGI-Perl script and noting the IP address of the user to just in case he/she clicks on the banner so as to return the proper URL.  The CGI script would return back the next image banner and place an Expires date on it.

The banner system this webpage is using seems less cumbursome then my webpage.  If you can tell me the method they use to do their banner system I'd be VERY grateful!  I must figure out this problem!

Thanks and good luck!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ratboyAuthor Commented:
Edited text of question
ratboyAuthor Commented:
Edited text of question
Looks like a site configuation to me.  The whole site has the same layout.  Nice site, but kept crashing my ie4 browser with the java on the pages.  If not too fussy on what banners, could always look at link exchange.  Alternatively, you could use perl or javascript/vb script to do it, but this as you said is cumbersome.
Sorry not too helpful.
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

I can't tell you exactly how this site does it but I think that it does it in more or less the same way as one I developed. If I explain that then the differences will only be minor details.

Firstly in case you aren't aware whenever a webserver outputs a page of HTML it parses the head section first. It does this so that it can convert and HTTP_EQUIV META tags in to HTTP messages that will be transmitted ahead of the HTML.

So what we do is to intercept this process and allow our own code to continue the parsing of the rest of the HTML page. Inside this page we place special tags which basically indicate were the banner is to be placed.

Typically these tags might look like this

<!--$ADVERT -->

As we parse the file we find this tag and replace it with the banner HTML.

Our processing at this point will determine which advert we are going to output. Typically we will have a file that will contain details of each potential advert along with a counter that denotes which one is to be displayed next.

In fact at this point you known what page you are processing so you can decide to use a different database for each page thus increasing the potential number of sale slots that you have.

In a similar vain page counters can be implemented in this way as well without the burdon of code to manipulate graphics as you simply output the appropriate HTML for each counter figure rather than a single images with all the characters processed into it.

The method to do all this is not CGI but NSAPI with the Netscape Server, ISAPI with IIS/PWS and whatever the API for Apache is for Apache. With the Java based servers a Java Servlet will have been used.

The fact that you see the banner in the cache but that this cached version does not appear to be used is indicitive of an already past expire date being associated with the images and HTML. The HTTP prototcol states that when the object is received it should be placed in the cache (except when a no-cache pragma is issued) and the expire date check when the page is NEXT requested. Consequently by setting the expiry of an object to be in the past when the page is next accessed it will find that it is out of date and send a conditional request to the server which will respond by stating that the page is out of date and here is a new one.

An alternative approach is to use a no-cache pragma HTTP message which will prevent the objects being cached at all but some older browsers didn't support this so there is a tendancy to utilise the expiry method instead. (However no browser that supports Java doesn't support the no-cache so there is no real point in this case).

Incidently you should realise that when you start up your browser all cached objects are check against the server unless you have the verify documents flag set to never.

Lastly don't be fooled into thinking that because something has a particular extension that it a particular file or type of processing. If you have access to the server and have a mind to you can make anything look like anything else. For example I have seen a references to index.html were index was the name of a PL/SQL Package in Oracle and .html was the name of a procedure within the the package. Thus rather than a page of HTML it represented a 'CGI style' call.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ratboyAuthor Commented:
So then you're saying the page is actually getting its banners inserted by the server, much like SSI code is parsed from an HTML?  Ok I can accept that but for the banner not caching, how is this done?

The grapical banner is inserted as an <IMG> tag and is actually a GIF picture file (no call to a CGI script).  How does this graphical banner, then, set itself to NOT be cached?  Does the server also send back a PRAGMA: NO-CACHE or EXPIRES:  header?  And if it does, these 2 headers don't seem to work in Internet Explorer 3.  That is, when you use these headers the graphic is still cached no matter what.  However, the HTTP webpage mentioned ( shows signs of 'not' caching in IE.

Please help me understand exactly what is going on, and can an APACHE server help me achieve all these effects for my website, and is there a simpler solution to achieve the exact effect?

Thanks a bunch EVERYONE!
SSI is done as part of the parsing of the HTML so the two are related.

The HTTP pragma nocache is issued to prevent caching of the image. This does work in IE3 but at times seems a bit pickey when it comes to the exact format of the message.

Incidently older browsers didn't support nocache and a trick was to send no-cache and expires so that if one trick didn't work the other would. However these two messages according to the HTTP definition of there role makes them exclusive as the expires message should actually cache the element when received and only check the expiry date when the element is next accessed even if the expiry date is passed when it is first received. Therefore if you send both headers to a browser it has to make a choice as to which one it will ignore. I seem to recall that netscape 3 ignores the expires and IE 3 ignores the nocache. However it maybe that the order of the messages has an effect.

You can achieve this technique with most servers including Apache. The technique that I mentioned would be differcult with Oracle Web server and not the best way of doing things with IIS (where you would use ASPs ad rotator object).

There are a number of other ways that you can achieve the same sort of effect including using server push and CGI techniques which is the simplest really depends on your own areas of experience.

If you are patience I am currently writing a document on this very subject which will be on my Web site when it is relaunched next month. (
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development Software

From novice to tech pro — start learning today.