I have a sidebar on each page of my site that needs to be wider or narrower depending on where you are on my site. Currently, I have this line of code in the header of each page:
if ($_SERVER[SCRIPT_NAME] == "/index.php")
$width = $homepagewidth;
else if (strstr($_SERVER['SCRIPT_NAME'],"forum"))
$width = $forumwidth;
else
$width = $restofsitewidth;
Is it inefficient to check the SCRIPT_NAME variable on each and every page?
Thanks.