PHP Help?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
adilmarwat2004
Forum Commoner
Posts: 44
Joined: Fri Sep 04, 2009 11:28 pm

PHP Help?

Post by adilmarwat2004 »

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
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: PHP Help?

Post by AbraCadaver »

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.
lshaw
Forum Commoner
Posts: 69
Joined: Mon Apr 20, 2009 3:40 pm
Location: United Kingdom

Re: PHP Help?

Post by lshaw »

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?

Post by adilmarwat2004 »

thank you so much
Post Reply