Pages: [1]   Go Down
Send this topic | Print
Author Topic: Option to Send Other Extensions to PHP  (Read 2315 times)
Jesdisciple
Hyper-Active Member
***
Offline Offline

Posts: 119


WWW
« on: March 03, 2008, 10:06:42 AM »

I'd like to be able to check some boxes to parse PHP in my .js and .css files.  This would make it easier to use the same script/style multiple times and, in the case of JavaScript, automatically include any required libraries of a script that makes use of the feature.  As it is, I can do this by using .js.php and .css.php (the first part being intended to remind me what I did), but 1) the server will send the file with a MIME type of "text/html," 2) any text editor with syntax-highlighting will highlight the wrong stuff, and 3) remembering to do so can be difficult and (when I forget) inconvenient.

EDIT: This also makes it possible to write dynamic CSS, which is convenient when several values are related (mathematically or as strings).
« Last Edit: March 03, 2008, 10:09:59 AM by Jesdisciple » Logged
inp o҉rtb
The Gangsta
Global Moderator
Official 110mb Guru
*****
Offline Offline

Posts: 15610


experimental theologian


WWW
« Reply #1 on: March 03, 2008, 10:27:56 AM »

You can do that using .htaccess, I believe. I haven't had much experience with .htaccess, but other members may have pulled this off.
Logged

Hi! I’m a signature virus! Add me to your signature to help me spread.
spam me: ispamspot@gmail.com

blog | my work @ deviantART | Imagine-ng image editor
soren121
I eat lots of those
Advanced Authority Member
*****
Offline Offline

Posts: 1476


I shall stare you down with mah kitteh powahs!


WWW
« Reply #2 on: March 03, 2008, 08:16:38 PM »

You can add handlers for PHP to your .htaccess, it's true. This should work:

Quote
AddHandler application/x-httpd-php5 .css
AddHandler application/x-httpd-php5 .js
« Last Edit: March 03, 2008, 08:19:33 PM by soren121 » Logged

LightBlog Developer -- Fueled by Linkin Park, Sprite, and LOLCats
Jesdisciple
Hyper-Active Member
***
Offline Offline

Posts: 119


WWW
« Reply #3 on: March 04, 2008, 07:41:47 AM »

Dern.  I just found out that .htaccess costs.  I don't pay for it and don't plan to anytime soon (at least until I have income from my site).

Logged
Pages: [1]   Go Up
Send this topic | Print
Jump to: