| | |
PHP: Fetching 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 http://www 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
Please help.
Thanx
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 http://www 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
PHP Syntax (Toggle Plain Text)
<?php echo $_SERVER['HTTP_HOST']; ?>
Please help.
Thanx
![]() |
Other Threads in the PHP Forum
- Previous Thread: row to colum
- Next Thread: About Popup Window
Views: 753 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for PHP
access ajax apache api archive array auto box buttons cakephp cart check checkbox class classes cms code combobox css curl database date development directory display download dropdown drupal dynamic echo email error file files form forms functions header href htaccess html image include insert integration ip java javascript joomla jquery limit link list login lookup loop mail menu methods mlm mod_rewrite multiple mysql onclick order parse password paypal php problem query radio recursion regex remote rows script search select server session sort source sql string structure syntax table update upload url user validate validation variable video web website wordpress xml





