Welcome to Dream.In.Code
Become an Expert!

Join 150,417 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,051 people online right now. Registration is fast and FREE... Join Now!




CSS & PHP

 
Reply to this topicStart new topic

CSS & PHP, How to use PHP to generate a CSS stylesheet?

dclauss
18 Mar, 2008 - 06:16 AM
Post #1

New D.I.C Head
*

Joined: 29 Nov, 2005
Posts: 9


My Contributions
Has anyone found a way to have PHP generate a CSS stylesheet?
I want to change the style based on calendar holidays Like on Christmas I want my pages to turn Green and maybe StPatties day too.
cool.gif

User is offlineProfile CardPM
+Quote Post

thehat
RE: CSS & PHP
18 Mar, 2008 - 06:34 AM
Post #2

D.I.C Head
Group Icon

Joined: 28 Feb, 2008
Posts: 217


Dream Kudos: 100
My Contributions
Put this at the top of your css file and save as .php:
php

<?php
header("content-type:text/css");
?>

User is offlineProfile CardPM
+Quote Post

dclauss
RE: CSS & PHP
18 Mar, 2008 - 07:11 AM
Post #3

New D.I.C Head
*

Joined: 29 Nov, 2005
Posts: 9


My Contributions
QUOTE(thehat @ 18 Mar, 2008 - 08:34 AM) *

Put this at the top of your css file and save as .php:
php

<?php
header("content-type:text/css");
?>




That is it. A bing..
Thanks!
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/9/09 08:12PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month