Forum Moderators: coopster
My website is template based, and all of the templates contents are stored in a database. Well my css code is stored in a template, which is in the database. Currently I am just echoing out the content by using a variable like $global_css. Well the downside to this is that I have to put all of the CSS in <style> tags, so it doesnt get cached. So inorder to cache the CSS I need to use a link tag instead of <style></style> tags. So the only way to use the link tag is to link to a css file. Well since all of my CSS is stored in the database I figured I would just echo out my css in a php file and then just link to that, but I have been unsuccessful. Basically my question is, why doesn't this work?
<link rel="stylesheet" type="text/css" href="echocss.php" media="all" />
When you go to echocss.php its the same exact thing as going to a css file. It has all of the css information in it. I even tried changing the type and it didnt work either:
<link rel="stylesheet" type="application/x-httpd-php" href="echocss.php" media="all" />
Does it have to be a .css file? Any ideas how I can do this using a php file?
Thanks for your help.