Web Design Forum  
 
Go Back   Web Design Forum > Web and Graphic Design > Web Design

Reply
 
LinkBack Thread Tools Display Modes
Old 02-21-2011, 05:44 AM   #1
New Member
 
Join Date: Feb 2011
Posts: 4
Default Banner Refresh Problem

Hello,

I have a site with several banners and backgrounds that I update each week. They are all just standard JPG images. The problem is that when I update them and go to the site to see them I have to refresh the page. How can I get it so that the new images load just by visiting the site? Please help. Thank you.
mikebarbaro is offline   Reply With Quote


Old 02-21-2011, 06:04 AM   #2
Gold Member
 
Join Date: Feb 2011
Location: Australia
Posts: 369
Default

Depending on the language you are using you can assign a random value to the images. So individual browsers think they are new images that need to be loaded.

PHP Example:
Code:
<img src="img.jpg?rand=<?=rand(1,1000);?>" />
ASP Example:
Code:
<img src="img.jpg?rand=<%=now()%>" />
I'm sure there would be a way in javascript but i'd have to work it out.
DHDdirect is offline   Reply With Quote
Old 02-21-2011, 06:45 AM   #3
New Member
 
Join Date: Feb 2011
Posts: 4
Default

im using php
mikebarbaro is offline   Reply With Quote
Old 02-21-2011, 06:48 AM   #4
New Member
 
Join Date: Feb 2011
Posts: 4
Default

that can't be used for the background though right?
mikebarbaro is offline   Reply With Quote
Old 02-21-2011, 06:54 AM   #5
Gold Member
 
Join Date: Feb 2011
Location: Australia
Posts: 369
Default

I don't see why not. Give it a shot and report back.
DHDdirect is offline   Reply With Quote


Reply

Tags
banner, html, images, web

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:28 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.