Hi, I am new to these forums and would really appreciate some advice on a piece of coding I have done.
Basically what I am trying to do is on our intranet, display a different home page banner depending on the time of the year. For example, display a halloween banner for halloween. So this is the code I have put in to do the trick but as I am no expert on PHP I was wondering if there was an easier way of doing it.
$currday = date('d'); // gets the current day of the year
$currmonth = date('m'); // gets the current month of the year
if ($currmonth == '09') { // if in October, display Halloween banner
if ($currday >= '12' && $currday <='31') {
echo "<img src='images/buttons_banners/newsbar_banner_halloween.jpg' alt='Happy Halloween'/>";
} else {
echo "<img src='images/buttons_banners/newsbar_banner_staff.jpg' alt='Welcome'/>";
}
} elseif ($currmonth == '11') { // if in November, display bonfire night banner
if ($currday >= '03' && $currday <='05') {
echo "<img src='images/buttons_banners/newsbar_banner_bonfire.jpg' alt='remember remember'/>";
} else {
echo "<img src='images/buttons_banners/newsbar_banner_staff.jpg' alt='Welcome'/>";
}
} elseif ($currmonth == '12') { // if in December, display xmas banner
if ($currday >= '01' && $currday <='31') {
echo "<img src='images/buttons_banners/newsbar_banner_xmas.jpg' alt='Merry Christmas'/>";
} else {
echo "<img src='images/buttons_banners/newsbar_banner_staff.jpg' alt='Welcome'/>";
}
} else { // anything else, display default banner
echo "<img src='images/buttons_banners/newsbar_banner_staff.jpg' alt='Welcome'/>";
}
Any help would be appreciated.
Need Successful Return
Hello I am currently working a form here, and I have everything figured out except when I click the return button from my preview view. the information is lost in all the textarea's. Any clue what I
Session login issue
I'm wondering how to fix a problem I'm having with a session-based login systemSay I go to http://www.website.comThe page that processes the login then returns the now-logged-in user to
Relative path
I have a absolute path to an image - like so: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/nigeria/images/uploaded/1/71256119068_51fe7f0fd342377.jpegHow can I get the relative document
A WBS element with the name XXX already exists in version FREI_VERSION
Hi.
PHP Game
hy i was wondering what's the best method in order to make some automatic updates in a php gamelet's say that the user should gain 1gold each minute but the user is not logged in and the process is
PHP arrays into arrays need help
HelloI am trying to highlight the days on my calendar based on the dates that i have in my database. Currently I can only get it to display the last element in the database which leads me to believe
Database/Table Collation
What is the Database, and table collations used for? i don't understand what there used for since columns have there already set collation....
HTAccess auto log in?
Hi all.Too busy driving celebs about lately so I hope someone here can help me out.I need a script that will allow a user to access an HTAccess directory automatically, without the need of
help with php
It's not displaying or pulling anything out of the database. Code: <html><head><title>Hale's Music World: Inventory Search
Can't find a decent web analytics!!!
I've downloaded and installed Piwik. It's location detection based on IP addresses is fairly inaccurate even after installing the recommended plugins. Can someone please suggest a free solution with