Re: [PHP-DEV] function basename()

2001-07-30 Thread Marcus


<[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:
...
$url) {
  $base = basename( $url); // HERE BASENAME HAS TO EXCLUDE
QUERY
  if ( $basename==$current_view) {
echo "$view\n";
  } else {
echo "$view\n";
  }
}
?>
...



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] function basename()

2001-07-29 Thread teo

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__);

-- teodor

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] function basename()

2001-07-27 Thread Marcus

Yes $PHP_SELF exists but it contains just the actual script. And therefore i
missed
a function for extracting filenames from urls. I needed to extract the
scriptname from
the url to identify the navigation position

marcus

"Stig S. Bakken" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Marcus wrote:
> >
> > shouldn't the function basename() return only the
> > script part and not the query part?
> >
> > Yes i know it would make a difference if a filesystem could have '?' in
> > filenames or if you wanted to handle those for search operations. But
> > perhaps ther could be another switch or just a function
> > filename/scriptname()
>
> You're probably looking for the $PHP_SELF variable.  basename() is for
> file names, not HTTP paths.
>
>  - Stig



-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] function basename()

2001-07-26 Thread Stig S. Bakken

Marcus wrote:
> 
> shouldn't the function basename() return only the
> script part and not the query part?
> 
> Yes i know it would make a difference if a filesystem could have '?' in
> filenames or if you wanted to handle those for search operations. But
> perhaps ther could be another switch or just a function
> filename/scriptname()

You're probably looking for the $PHP_SELF variable.  basename() is for
file names, not HTTP paths.

 - Stig

-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]