Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Banner rotator "cachnig" problem

Status
Not open for further replies.

c4n

Programmer
Mar 12, 2002
110
SI
This probably can be explained much more simple, but here's my way:

Let's say I have to pages - "page1.htm" and "page2.htm".

On both pages I use a banner displayed by a banner rotator. First I am on page1 and I see banner1 on it. Then I go to page2 and see again banner1, but I would like to see banner2.
Now I click the "Back" button in my Browser (IE5.5) and it takes me back to page1 where I again see banner1 (but would like to see banner3 now)!

So, is there a way to prevent caching the banner1 WHITOUT using <META HTTP-EQUIV=&quot;Pragma&quot; CONTENT=&quot;no-cache&quot;>? The problem is I am using <SCRIPT language=Javascript src=&quot;banner_rotator.cgi&quot;></SCRIPT> to display the banner but my browser but the browser saves output of the CGI in &quot;Temporary Internet Files&quot; folder and uses it on all pages (so I have to reload a page to get a new banner).

Below is a simple Perl code I use. Any ideas?

Thanks!

-------------------------------

#!/usr/bin/perl

$mypic[0]=&quot;<a href=link.htm><img src=image.gif height=60 width=468 alt=Banner1></a>&quot;;
$mypic[1]=&quot;<a href=link.htm><img src=image2.gif height=60 width=468 alt=Banner2></a>&quot;;
$mypic[2]=&quot;<a href=link.htm><img src=image3.gif height=60 width=468 alt=Banner3></a>&quot;;

srand;
$i = int(rand(2));

print &quot;Content-type: text/html\n\n&quot;;
print &quot;document.write('$mypic[$i]');&quot;;

---------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top