hello there i need help with this. i have two files css1.php and css2.php if the user is on the root folder of the domain i need to include css1.php and if users are inside another like /incomes i need to inlcude css2.php. i want to do this because i am using only 1 header for all the site and the header has to include the css file.
right now i have this
$svr = $_SERVER['SCRIPT_FILENAME'];
if ($svr == '/home6/dakproj1/public_html/condominios/.com/administrator.php') {
echo 'background-image:url(images/'.$linea['imagenHeader'].'); background-repeat:no-repeat;';
} else {
echo 'background-image:url(../images/'.$linea['imagenHeader'].'); background-repeat:no-repeat;';
}
i want to optimize this because this is a site i will have to replicate 4 or 5 times and on the server that path doesn't change automatically.....
how can i detect i am on the root or inside a subfolder..... thanks.