[thelist] PHP $SCRIPT_NAME or

kristina ml at kfxdesign.net
Fri Jan 17 08:32:01 CST 2003


evolters,

  Sorry I seem to be on a bit of a list-hogging
  mission at the moment...!

  I'm trying to get a little text navigation menu
  working that gets included via php.

  I also want it to test and see what page is open
  and unlink that menu item.  - So that visitors
  know where they are on the site.

  So I've been doing a bit of searching and found
  two ways of doing what I need.  I'm just curious
  as to which one is the preferred method.

  if ($SCRIPT_NAME == '/menuItem') {
  menuItem
  } else {
  <.a href"menutItem.php">menuItem<./a>
  }

  [or]

  if($page == "menutItem") {
  menuItem
  } else {
  <.a href"menutItem.php">menuItem<./a>
  }

  and then each page has

  $page = "menutItem";

  ----

  I don't know enough about PHP to be able to say
  which way is the better way.  But I do know that
  I have trouble getting the first one to work...!

  I would like to try and use the better way (if
  there is one)

  or is there a better alternative to
  $SCRIPT_NAME?

--
tia

bfn
.kristina

ml at kfxdesign.net
kfxdesign.net




More information about the thelist mailing list