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" Quote Link to comment 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... Quote Link to comment 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 Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.