WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search


Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder



Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Change the background color of a website daily dynamically using the php date function to get the current day of the week and depending on that day, set the background color for the web page.
Categories : PHP, Date Time, Beginner Guides, Web Design Click here to Update Your Picture
Rupali Gulande
Date : Jul 19th 2007
Grade : 3 of 5 (graded 3 times)
Viewed : 15717
File : 4676.zip
Images : No Images for this code example.
Search : More code by Rupali Gulande
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?php
       
if(date("D") == "Sun")
        {
       
$BGColour = "#CCCCCC";
        }
        elseif(
date("D") == "Mon")
        {
       
$BGColour = "#A6CAF0";
        }
        elseif(
date("D") == "Tue")
        {
       
$BGColour = "#E79703";
        }
        elseif(
date("D") == "Wed")
        {
       
$BGColour = "#AE9675";
        }
        elseif(
date("D") == "Thu")
        {
       
$BGColour = "#CFDDF4";
        }
        elseif(
date("D") == "Fri")
        {
       
$BGColour = "#CCCCCC";
        }
        elseif(
date("D") == "Sat")
        {
       
$BGColour = "#A6CAF0";
        }
   
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Change Site Background color daily Using PHP Dynamically</title>
</head>
<body bgcolor="<?php print ("$BGColour"); ?>">
</body>
</html>






Find the day of the week for any given year/month/day.
Categories : PHP, Date Time, Data Validation, Algorithms, Beginner Guides
Find if a year is leap.
Categories : PHP, Date Time, Beginner Guides, Data Validation
Count Number Of weeks in Month
Categories : PHP, Date Time, Beginner Guides
Kewl Date Example
Categories : PHP, HTML and PHP, Date Time, CSS, Beginner Guides
Simple Javascript CSS Digital Clock
Categories : Java Script, Date Time, CSS, Beginner Guides, Web Design
Script loading time
Categories : PHP, Beginner Guides, Date Time
Local Time clock and Server time usign PHP and JavaScript
Categories : PHP, Java Script, Date Time, Beginner Guides
How to Insert a Date Format Into MySQL from PHP
Categories : PHP, Databases, MySQL, Date Time, Beginner Guides
This code consists of two parts, the first part is a .html file that uses a form to pass 3 date variables into day_of_week.php3 You input the mm/dd/yyyy of the day then it prints what day of the week that day falls on.
Categories : Date Time, PHP, Complete Programs
Simple PHP control CSS Calendar
Categories : PHP, HTML and PHP, Calendar, Date Time, CSS
Making a simple Hit-Log using PHP and MySql
Categories : PHP, Log Files, Beginner Guides, Databases, MySQL
Newbie Notes #10 - Generating drop downs
Categories : PHP, MySQL, HTML, Beginner Guides, Databases
Reverse a given number
Categories : PHP, Beginner Guides, Algorithms, Math.
Temperature Conversion
Categories : PHP, Math., Beginner Guides
Convert date's in YYYY-MM-DD (i.e. mysql format) into PHP3 timestamps. Also Find the difference in days between two PHP3 timestamps.
Categories : HTML and PHP, PHP, MySQL, Date Time