Carl Miller wrote:
I'm trying to setup a simple random image script to allow other websites to
display random banner ads located on my server.

The other website would call the perl script in an <img> tag, like so:

<img src="http://www.my_site.com/cgi-bin/random_banner.cgi"; width="468"
height="60">

I've tried several perl scripts that basically work, but the problem is
always the same with all of them: the browser always caches
'random_banner.cgi' causing the same banner to be displayed on every
subsequent page. The only way to see a different banner is to hit
Reload/Refresh.

Is there a script out there that avoids the cache problem in displaying
random banners via an <img> tag?

Let the script print a couple of no-cache CGI headers:

    print "Cache-Control: no-cache\n";
    print "Pragma: no-cache\n";  # for HTTP/1.0

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to