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.
Including calander to page - will not show other months than current??
im trying to add an existaing calander onto a profile page by using Code: <?php include "diary/cal_show.php";?>which looks like this...But when i hit either arrows to move on
Sending CC Info by email
I am a little bit less knowledgable in the security area as most developers and I know I have a lot to learn so maybe this is a start. But I have a client who just came over to us and previously was
Calander layout
Hi i know this sounds like a simple question but i cant find the answer to it anywhere i have added a simple calander tool to the page and added some styles to it but i want to move the month name
How to pass parameter to tag query?
Hi,
ORA-00932: inconsistent datatypes: expected - got CLOB
SO : windows xp
Matchcode in ALV change header column
Hello everyone,
image upload script not working with png
The basic process of this php code is to take the submitted file, convert it to a small JPG thumbnail and put it into one directory and save the original file into another, but it seems that when
validating url
im trying to validate url's sent to me by a formthe url's im collecting are for placing banners on my site so the url's are the link to there site and url of where there banner isURL's ARE BROKEN INTO
Having Problem with Date
l have a submit buttom where user have the possibility to add a date to specify when his message should be made reachable online.I have seen a bug which l am not having a clue to solve and l need
Nested (echoed) php running wrong script
Got a problem with a php website I'm creating.In a nutshell, the first page is entirely html and calls a php script to process an uploaded file and some form fields using POST. After validating the