[COLOR=black]WHEN the script name = contact.php[/COLOR]
[COLOR=#007700][COLOR=#007700][COLOR=black]it still does this [/COLOR][FONT=Courier New]echo [COLOR=#dd0000]"<div class='home-nav'>"[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];[/FONT]
[/COLOR][COLOR=black]it does not [FONT=Courier New][COLOR=#007700]echo [/COLOR][COLOR=#dd0000]"<div class='inner-nav'>"[/COLOR][/FONT][COLOR=#007700][FONT=Courier New];[/FONT]
@criterion9Nov 17.2010 — #Try this to see if you are getting the results you want: [code=php] echo "Script name: ".$_SERVER['SCRIPT_NAME']."<br />"; if ($_SERVER['SCRIPT_NAME'] == "index.php") { echo "<div class='home-nav'>"; } else { echo "<div class='inner-nav'>"; } [/code]
@NogDogNov 17.2010 — #I believe $_SERVER['SCRIPT_NAME'] will be from the web root directory, so it might have a value like "/directory_name/file_name.php", in case that's your issue.
PS: Maybe use the basename() function? [code=php] if(basename($_SERVER['SCRIPT_NAME']) == index.php) { [/code]