User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 423,637 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,215 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting

$_server['script_name']

Join Date: May 2008
Posts: 31
Reputation: rgviza is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
rgviza rgviza is offline Offline
Light Poster

Re: $_server['script_name']

  #13  
May 15th, 2008
I'm actually surprised this works at all anywhere because the result will look like:
<li class="linkLevel01"><a href="index.php" class="homy"style="background-color: #6C674F">Home</a></li>
when printed to the page. You need a space before style=

so you end up with:
<li class="linkLevel01">
-------------------------------| |-----------
<a href="index.php" class="homy" style="background-color:#6C674F">Home</a>
</li>

If the browser parses attributes correctly it won't see the style at all as it is.

You can almost always sanity check whether it's a php problem or html by echoing "Made it to here" or something within the conditional logic:
#
if($_SERVER['SCRIPT_NAME'] == 'index.php')
#
{
#
//sanity check
echo "Made it to here";exit;
$style_home = 'style="background-color: #6C674F"';
#
}
if it prints the test and the script exits, php is fine.

-r
Reply With Quote  
All times are GMT -4. The time now is 10:09 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC