PHP is generated BEFORE everything and is done on the server side, thats why you dont see any PHP code or anything when it is generated in pure HTML... Therefore, the example you gave is correct, for the most part, in that that will select which color to use in terms of the date, you may want to run something that checks to see if its any certain date, and if so set it to that color, if it isnt, set it to the default color and print it that way. This is how most sites have different modules that allow for color changes, they simple have a thing like: echo $background["color"]; Where $background is a query into a database of the different possible colors and usernames...it then picks out their color selection and replaces all the coding you did with the word "brown" thus making the background color brown for that selected user. :)