Re: variables in CSS in PHP question/problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 2:15 AM -0500 3/14/07, Richard Lynch wrote:
Surf directly to your CSS URL and see what happens.

There are several possibiliies:
#1.
Your CSS has <?php ... ?> in its output, because you have not
convinced your web-server to run your CSS file through PHP to compute
the dynamic result.

You need something like this in .htacces:

<File whatever.css>
  ForceType application/x-httpd-php
</File>

whatever.css should be your CSS filename.


To all:

In addition to what Richard said:

I came into this conversation late, so please forgive me if I'm not on track, but if one is trying to use php variables in css, you might want to place this at the top of your css files:

<?php header('Content-Type: text/css; charset=UTF-8'); ?>

and then add this to your .htacces file:

<FilesMatch "\.(htm|html|css|tpl)$">
 SetHandler application/x-httpd-php
</FilesMatch>

After that, you can set variables within your css files by <?php echo(<whatever>) ?>

hth's

tedd

--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux