syntax101 Posted December 13, 2007 Share Posted December 13, 2007 php how do i get the url of my website and put it i a variable and cut the address ex: http://localhost/index.html result in a variabl would be var="http://localhost/" other example http://123.168.1/index.html result in a variable would be var="http://123.168.1/ NOTE: the remaing characters will not be included when put in a variable like "index.html" Link to comment https://forums.phpfreaks.com/topic/81508-php-help-with-how-to-get-the-url/ Share on other sites More sharing options...
Crew-Portal Posted December 13, 2007 Share Posted December 13, 2007 I dont get your problem wether the index is defined or not it still goes to the index. Like http://www.phpfreaks.com and http://www.phpfreaks.com/index.php They both go to the same place wether the inde is in thier or not... Link to comment https://forums.phpfreaks.com/topic/81508-php-help-with-how-to-get-the-url/#findComment-413794 Share on other sites More sharing options...
syntax101 Posted December 13, 2007 Author Share Posted December 13, 2007 what i mean is get the current url and put the url to a varialbe string so i can modify it like http://www.tyrants.com/hvillacruz.com all i want to get is http://www.tyrants.com Link to comment https://forums.phpfreaks.com/topic/81508-php-help-with-how-to-get-the-url/#findComment-413798 Share on other sites More sharing options...
emehrkay Posted December 13, 2007 Share Posted December 13, 2007 you want to look at the $_SERVER superglobal http://us3.php.net/manual/en/reserved.variables.php Link to comment https://forums.phpfreaks.com/topic/81508-php-help-with-how-to-get-the-url/#findComment-413799 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.