Thread: php in css
View Single Post
Old 23-06-2007, 00:15   #4 (permalink)
d3mcfadden
Senior Member
 
d3mcfadden's Avatar
 
Join Date: Apr 2005
Location: -
Posts: 694
Send a message via AIM to d3mcfadden
Here's your problem:
Quote:
if(basename($_SERVER['PHP_SELF'], '.php') == 'index')
PHP_SELF is not index.php in this case, it is css.php. This is because you are not "including" the file into index.php you are bringing it in via a <link> therefore it is it's own script with it's PHP_SELF reflecting it's name.

Easiest solution I think would be to pass the basename to the css file via querystring.
HTML Code:
<link rel="stylesheet" type="text/css" href="style/css.php?base=BASENAME" />
Reality is, there is probably much better logic than this, I just don't know what you are trying to achieve.

Last edited by d3mcfadden : 23-06-2007 at 11:18.
  Reply With Quote