Re: [PHP] PHP and getting part of URL

2008-10-08 Thread Per Jessen
Jason ML wrote: > Hi PHP'ers, > > PHP 4.4.8 and 5. > > say I have a url like: > > http://www.mydomain.tld/jason/index.php > > In that index.php I want to have a piece of code that runs that tells > me the 'jason' part of the URL so that I can run some custom read only > queries for 'jason' >

Re: [PHP] PHP and getting part of URL

2008-10-07 Thread Micah Gersten
Your original post has this as the URL: > http://www.mydomain.tld/jason/index.php That's why I gave you that command. If you want jason out of what you posted, Check out the following commands: http://us.php.net/array_pop http://us.php.net/explode Thank you, Micah Gersten onShore Networks Inte

Re: [PHP] PHP and getting part of URL

2008-10-07 Thread Jason ML
Daniel, I get: URL: /net1003/people Thoughts on what I am doing wrong. Yeah. Not R'ing TFM. dirname() gives you the name of the directory ABOVE what you pass. http://php.net/dirname Thanks for the pointer. You are indeed correct. -Jason -- PHP General Mailing List (http://ww

Re: [PHP] PHP and getting part of URL

2008-10-07 Thread Daniel Brown
On Tue, Oct 7, 2008 at 7:57 PM, Jason ML <[EMAIL PROTECTED]> wrote: > > But then doing: > >$jason = dirname($_SERVER['REQUEST_URI']); > >echo "URL: "; >echo $jason; > > I get: URL: /net1003/people > > Thoughts on what I am doing wrong. Yeah. Not R'ing TFM. dirname() g

Re: [PHP] PHP and getting part of URL

2008-10-07 Thread Jason ML
Hi Micah, dirname($_SERVER['REQUEST_URI']); I have tried that and I dont get the proper URI: Example running print_r($_SERVER); I get: [REQUEST_URI] => /net1003/ people/jason/ But then doing: $jason = dirname($_SERVER['REQUEST_URI']); echo "URL:

Re: [PHP] PHP and getting part of URL

2008-10-07 Thread Micah Gersten
dirname($_SERVER['REQUEST_URI']); Thank you, Micah Gersten onShore Networks Internal Developer http://www.onshore.com Jason ML wrote: > Hi PHP'ers, > > PHP 4.4.8 and 5. > > say I have a url like: > > http://www.mydomain.tld/jason/index.php > > In that index.php I want to have a piece of code th

Re: [PHP] PHP and getting part of URL

2008-10-07 Thread Chris
Jason ML wrote: Hi PHP'ers, PHP 4.4.8 and 5. say I have a url like: http://www.mydomain.tld/jason/index.php In that index.php I want to have a piece of code that runs that tells me the 'jason' part of the URL so that I can run some custom read only queries for 'jason' How can I do this? I

[PHP] PHP and getting part of URL

2008-10-07 Thread Jason ML
Hi PHP'ers, PHP 4.4.8 and 5. say I have a url like: http://www.mydomain.tld/jason/index.php In that index.php I want to have a piece of code that runs that tells me the 'jason' part of the URL so that I can run some custom read only queries for 'jason' How can I do this? I know how to do