Forum Moderators: phranque

Message Too Old, No Replies

php code in css files

how to setup your apache to allow php in css

         

alexis

9:31 am on Feb 18, 2005 (gmt 0)

10+ Year Member



This is jut to add an information to the thread [webmasterworld.com...] which helped me a lot

I am using php code in css files to make small changes acording to the language and other variables that need to be passed.

-----------------------------

To get it to work on Apache running PHP as a module add this in the httpd.conf either in the general area or in a virtual host(if you want only that virtual host to run css files through the php module). You can also add it to a .htaccess file

<IfModule mod_mime.c>
AddType application/x-httpd-php .css
</IfModule>

--------------------

If you run Apache as a CGI application add the following:

Action application/x-php /cgi-bin/php
AddType application/x-php .css

(for the CGI solution I only tested it in a .htaccess file since my hosting service does not allow me to modify the httpd.conf file)

jdMorgan

6:03 pm on Feb 18, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Very nice, Alexis -- Thanks for posting!

Jim