View Full Version : Having an image 'expire' automatically from a website

02-07-2009, 05:11 PM
Hi all,

Is there any way to have an image on a website page, automatically 'expire' so it's not visible after a particular period of time?

For example, a list of news or items, that has an image file that says 'new' next to it. But after a particular period of time, I don't want the 'new' image displayed at all.
Is there anyway with the page coding, to have that image automatically not appear after a predefined period? Or, is the only way to change and upload the page again after manually changing it.

Thanks in advance...

02-07-2009, 10:23 PM

This may be what you are looking for.........


Latest additions list AutoExpire script


03-07-2009, 01:01 AM
<title>time expire test</title>
$time = date('c');

if($time <= "2009-07-03T12:30:00+12:00"){
echo '<img src="image.jpg" />';
} else {
echo 'no image';
This will show the image until just after lunch 12:30 on the 3 July 09, then it will display "no image"