View Single Post
  #1 (permalink)  
Old 2008-03-15, 11:47 PM
cancer10 cancer10 is offline
Junior Member
 
Join Date: Dec 2007
Posts: 13
cancer10 is on a distinguished road
Default PHP: Getching foldername from URL

Hi,

I came up with this problem last night.

I have a URL http://www.mysite.com

How do I fetch the folder name that was supplied in the URL.

For example:


http://www.mysite.com/xyz
or
http://mysite.com/myfolder
or
http://www.mysite.com/xxx


Please note that I can either use www or Test Page for the Apache HTTP Server & InterWorx-CP or just http:// in my domain name but I need to fetch the folder name that was supplied in the URL.

PS:

I tried the following code, but it didnt revealed the foldername supplied

Code:
<?php
echo $_SERVER['HTTP_HOST'];
?>


Please help.


Thanx
Reply With Quote