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 401,591 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,700 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: 6
Reputation: jstorz is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jstorz jstorz is offline Offline
Newbie Poster

Re: $_server['script_name']

  #4  
May 10th, 2008
try this,

  1. if (preg_match("/bobo\/index.php/i",$_SERVER['REQUEST_URI'])) {
  2. $style_home = 'style="background-color: #6C674F"';
  3. }

instead of

  1. if($_SERVER['SCRIPT_NAME'] == '/bobo/index.php')
  2. {
  3. $style_home = 'style="background-color: #6C674F"';
  4. }

or like was said above just echo $_SERVER['SCRIPT_NAME'] ; to see what the variable actually is and adjust from there.

Originally Posted by phploveisgood View Post
Excuse me! I don't realy understand what you mean. These are my code:

<?php
if($_SERVER['SCRIPT_NAME'] == '/bobo/index.php')
{
$style_home = 'style="background-color: #6C674F"';
}
?>
<ul>


<li class="linkLevel01"><a href="index.php" class="homy"<?php echo $style_home ?>>Home</a></li>

What would you have done to make it work.
Last edited by peter_budo : May 11th, 2008 at 1:04 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
All times are GMT -4. The time now is 4:41 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC