I have two pic files one banner.jpeg and 2nd banner_chrismas.jpeg
I want to use these two jpeg files as banner in php file as that when the 25-Dec-2010 comes then the banner_chrismas.jpeg banner should be set as a banner for one day. and when the 26-December-2010 comes it may returned to banner.jpeg
How it is possible. I need you kind help in this problem
Adil
PHP Help?
Moderator: General Moderators
- AbraCadaver
- DevNet Master
- Posts: 2572
- Joined: Mon Feb 24, 2003 10:12 am
- Location: The Republic of Texas
- Contact:
Re: PHP Help?
Lot's of ways:
Code: Select all
if(date('mdY') == '12252010') {
//echo christmas banner
} else {
//echo other banner
}mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Re: PHP Help?
If you want to check each year,
Code: Select all
$time=time(); //fetch the current time
$date=date("d/m",$time); //show the time value as 01/01
$christmas_day="25/12";//set christmas day, of any year
if($date==$christmas_day)
{
echo "<img src='christmas_banner.png />"; //echo cristmas banner
}
else
{
echo "<img src='normal_banner.png' />"; //echo normal banner
}
-
adilmarwat2004
- Forum Commoner
- Posts: 44
- Joined: Fri Sep 04, 2009 11:28 pm
Re: PHP Help?
thank you so much