| | |
PHP: Fetching foldername from URL
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
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: 707 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array beginner binary broken cakephp checkbox class cms code cron curl customizableitems database date directory display download dynamic echo email error file files folder form format forms forum function functions google headmethod href htaccess html image include insert integration ip java javascript joomla jquery limit link login loop mail malfunctioning menu methods mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search select server sessions sms soap source space speed sql structure syntax system table tutorial update updates upload url validation validator variable video web xml youtube





