page timing
Posted: Mon Oct 02, 2006 10:02 am
It intended to use php to diplay an image on a web site for three days after it has been uploaded to a webserver.
The was what I did I set an initial date in the format date('dmYHis');
This worked only if it falls within the month the site was uploaded but if it happens to be in the next month or the other year it never works as planned.
So I will like someone to help me out on this script of a diffrent method of doing it.
The was what I did I set an initial date in the format date('dmYHis');
Code: Select all
$initialdate = "02102006141401";
$threedays = "03000000000000"; //for day three
$present_time = date('dmYHis');
if($present_time >= ($initialdate + $threedays)) {
$welcomeImg = "";
}
else {
$welcomeImg = "/images/welcome.gif"; //image displayed within three days
}So I will like someone to help me out on this script of a diffrent method of doing it.