Ik check met onderstaande code of er een 2 of 3 columns CSS gebruikt moet worden.
Dit gaat prima. Alleen de check op $PHP_SELF == '/index.php' werkt niet.
Steeds krijg ik daar een 3col.css ipv de 2col.css.
Weet iemand wat ik fout doe in deze code?
<?php
//echo $_SERVER['PHP_SELF'] ; // result = http://www.domain.nl/product_info.php/info/634/Rowi-Bl...4200-Gaskachel/
//echo $PHP_SELF ; // result = /index.php
//echo HTTP_SERVER; // result = http://www.domain.nl
if (in_array($PHP_SELF, $filenames_array) || $PHP_SELF.'/cat/' == '/index.php/cat/' || $PHP_SELF.'?cat/' == '/index.php?cat/')
{
echo '<link rel="stylesheet" type="text/css" href="templates/'.CURRENT_TEMPLATE.'/stylesheet_3col.css" />';
} elseif ($_SERVER['PHP_SELF'] == HTTP_SERVER || $PHP_SELF == '/index.php') {
echo '<link rel="stylesheet" type="text/css" href="templates/'.CURRENT_TEMPLATE.'/stylesheet_2col.css" />';
} else {
echo '<link rel="stylesheet" type="text/css" href="templates/'.CURRENT_TEMPLATE.'/stylesheet_2col.css" />';
}
?>
782 views