McChicken Posted November 8, 2008 Share Posted November 8, 2008 Hey. I just installed a script that change my site logo on holidays, called "HLogoZ" My problem is that i want the script to show a logo from 1.Dec - 22.Dec and another logo from 23.Dec - 24.Dec. What change do I need to make here: ? } } // Christmas Eve else if ($today == "December 24, $year"){ if (file_exists("$logo_path/$logo_xmaseve")) { echo "<img src='$logo_url/$logo_xmaseve' alt='$logoalt' />"; } else { echo "$imagedefault"; } } // Christmas else if ($today == "December 25, $year"){ if (file_exists("$logo_path/$logo_xmas")) { echo "<img src='$logo_url/$logo_xmas' alt='$logoalt' />"; } else { echo "$imagedefault"; } } Quote Link to comment Share on other sites More sharing options...
BoltZ Posted November 8, 2008 Share Posted November 8, 2008 Are you declaring today's date in a variable? Quote Link to comment Share on other sites More sharing options...
php-pendejo Posted November 8, 2008 Share Posted November 8, 2008 untested but try that first } } // Christmas Eve else if ($today >= "December 1, $year") and ($today <= "December 22, $year"){ if (file_exists("$logo_path/$logo_xmaseve")) { echo "<img src='$logo_url/$logo_xmaseve' alt='$logoalt' />"; } else { echo "$imagedefault"; } } // Christmas else if ($today >= "December 23, $year") and ($today <= "December 24, $year"){ if (file_exists("$logo_path/$logo_xmas")) { echo "<img src='$logo_url/$logo_xmas' alt='$logoalt' />"; } else { echo "$imagedefault"; } } Quote Link to comment Share on other sites More sharing options...
corbin Posted November 8, 2008 Share Posted November 8, 2008 You can't compare strings like that. You can compare ordinal values of single characters, but not strings. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.