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.