Re: Using PHP with Style Sheets

From: Date: Mon, 19 Jan 2004 17:08:29 +0000
Subject: Re: Using PHP with Style Sheets
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-175039@lists.php.net to get a copy of this message
Freedomware wrote:
OK, it looks like there are at least three ways to do this. I now have an original style sheet with a .css extension and copies with .php and .css.php extensions. All three style sheets have the following code at the top: <? header("Content-Type: text/css"); ?>
I would think that the above is going to cause problems. First, if you have something like this... <html> <head> <title>My Page</title> <?php include ( "style.php" ); ?> </head> .... and style.php has the header call in it, you're going to get an error. Second, I don't know how much differently the browsers handle text/html and text/css, but being that the header has to be sent before any output to the browser, you will have changed the mime type of the whole document. Course, I could be wrong on all points....it's been known to happen before. ;) -- By-Tor.com It's all about the Rush http://www.by-tor.com

« previous php.general (#175039) next »