How to get the URL string?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rajaseeth
Forum Newbie
Posts: 4
Joined: Tue Nov 03, 2009 9:27 am

How to get the URL string?

Post by rajaseeth »

Hi,

I am new to PHP. I have a requirement. I have a url as http://localhost/TestApplication/Test.php. From the above url i want only "http://localhost". is there a method to get it?.

Thanks,
Raja
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: How to get the URL string?

Post by AbraCadaver »

Code: Select all

var_dump($_SERVER);
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
Reviresco
Forum Contributor
Posts: 172
Joined: Tue Feb 19, 2008 4:18 pm
Location: Milwaukee

Re: How to get the URL string?

Post by Reviresco »

Post Reply