<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Marcus!
> On Thu, 26 Jul 2001, Marcus wrote:
>
> > shouldn't the function basename() return only the
> > script part and not the query part?
> I guess basename() is a filesistem function, and hence it doesn't make
sense
> to care about `query string' cause in the file systems there are no such
> things.
>
> I guess you are trying to determine the name of the script from the query
> string or what exactly? If so, it's quite simple to use
basename(__FILE__);
>

No, i have a view selection - meaning on every page the user can select how
to
view the data. So there is a selection from those views. Each current view
can be
identified by basename( $PHP_SELF) which does not contain the query. The
list
of available views is generated dynamically into an array from an included
script.
Also the navigation is done in an included page becase every view includes
this.

Therefore:
1) if another view needs a query the navigation list must have that query.
2) __FILE__ cannot be userd as it is always the include file....

include1:
...
$nav = array( $view1=>$url1, $view2=>$url2...)
...

include2:
...
<selct ....
<?php
$current_view = basename( $PHP_SELF); // PHP_SELF HAS NO QUERY
foreach( $nav as $view=>$url) {
  $base = basename( $url);                 // HERE BASENAME HAS TO EXCLUDE
QUERY
  if ( $basename==$current_view) {
    echo "<option value='$url' selected>$view</option>\n";
  } else {
    echo "<option value='$url'>$view</option>\n";
  }
}
?></select>
...



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to