PDA

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



Chikara
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...

JonB
02-07-2009, 10:23 PM
Chikara

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

http://javascript.internet.com/

Latest additions list AutoExpire script

JonB

Rob99
03-07-2009, 01:01 AM
<html>
<head>
<title>time expire test</title>
</head>
<body>
<?php
$time = date('c');

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