Sunday, 27 November 2011

Change background color based on day of the week using if else elseif statements

<html>
<head>
<title>Background Colors change based on the day of the week</title>
</head>
<?
$today 
date("l");
print(
"$today");
if(
$today == "Sunday")
{
$bgcolor "#FEF0C5";
}
elseif(
$today == "Monday")
{
$bgcolor "#FFFFFF";
}
elseif(
$today == "Tuesday")
{
$bgcolor "#FBFFC4";
}
elseif(
$today == "Wednesday")
{
$bgcolor "#FFE0DD";
}
elseif(
$today == "Thursday")
{
$bgcolor "#E6EDFF";
}
elseif(
$today == "Friday")
{
$bgcolor "#E9FFE6";
}
else
{
// Since it is not any of the days above it must be Saturday$bgcolor "#F0F4F1";
}
print(
"<body bgcolor=\"$bgcolor\">\n"); ?><br>This just changes the color of the screen based on the day of the week
</body>
</html>

3 comments:

  1. Nice tutorial. Thanks for sharing the valuable information. it’s really helpful. Who want to learn this blog most helpful. Keep sharing on updated tutorials…
    Best Devops Training in pune
    Microsoft azure training in Bangalore
    Power bi training in Chennai

    ReplyDelete
  2. It seems you are so busy in last month. The detail you shared about your work and it is really impressive that's why i am waiting for your post because i get the new ideas over here and you really write so well.

    Selenium training in Chennai
    Selenium training in Bangalore
    Selenium training in Pune
    Selenium Online training

    ReplyDelete
  3. Fantastic work! This is the type of information that should follow collective approximately the web. Embarrassment captivating position Google for not positioning this transmit higher! Enlarge taking place greater than and visit my web situate
    online Python training
    python training in chennai

    ReplyDelete