Forum Home
Press F1
 
Thread ID: 101114 2009-07-02 05:11:00 Having an image 'expire' automatically from a website Chikara (5139) Press F1
Post ID Timestamp Content User
788092 2009-07-02 05:11:00 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...
Chikara (5139)
788093 2009-07-02 10:23:00 Chikara

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

http://javascript.internet.com/

Latest additions list AutoExpire script

JonB
JonB (1885)
788094 2009-07-02 13:01:00 <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"
Rob99 (151)
1