Mombu the Php Forum

Go Back   Mombu the Php Forum > Php > CSS in a .php file
User Name
Password
REGISTER NOW! Mark Forums Read




Reply Bookmark and Share
1 9th August 03:59
sheelpatel
External User
 
Posts: 1
Default CSS in a .php file



Hello, I am having a few issues calling the css from a php file
The html tag I am using to call the css file is:
<link rel="stylesheet" type="text/css" media="screen"
href="******css.php" />

and I have:
header("Content-type: text/css");

as the first line in the php file in which the css is located,

Could anyone please help me with this, for some reason I cannot seem to
get it to work, any and all help would be greatly appreciated, thankyou.
  Reply With Quote


 


2 9th August 09:57
mark van s
External User
 
Posts: 1
Default CSS in a .php file



I have once tried to dynamically include css and if i am not mistaken
you can just point to a php file if it just outputs the css as it
should look like. (didn't use the header() like you try to)

Another solution could be to include the css in the page

<style>
<?php include('style.php'); ?>
</style>

This will work fine (PHP script parses and outputs the css). Drawback
is that your CSS is outputted with every pagerequest and so the
advantage of write once (to client) and read many times (for each page
requested) is gone.

Your choice
  Reply With Quote


 


Reply


Thread Tools
Display Modes


Some other forums that might be of your interest : Php 5 forum, Apache forum, Iis forum, Functions forum, Classes forum, Librarys forum, Bugs forum, Postgres forum, Mysql forum, Paradox forum, Ms sql forum, Configurations forum, Php.ini forum, Problems forum, Scripting forum, Css forum, General forums, Off-topic talk, Links, Extra forums, Php


Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666