On Jan 5, 2008 12:06 PM, Alain Roger <[EMAIL PROTECTED]> wrote:
> Hi,
>
> let's imaging we have the following thing :
>
> www.mywebsite.com/company/index.php
> www.mywebsite.com/company/profile.php
> www.mywebsite.com/services/index.php
>
> how can i detect in which address am i ?
>
> for example how to retrieve www.mywebsite.com/services or
> www.mywebsite.com/company

<?
preg_match('/\/(.*)\//',$_SERVER['REQUEST_URI'],$match);
echo $match[1];
?>


-- 
Daniel P. Brown
[Phone Numbers Go Here!]
[They're Hidden From View!]

If at first you don't succeed, stick to what you know best so that you
can make enough money to pay someone else to do it for you.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to