Bman900 Posted May 30, 2009 Share Posted May 30, 2009 Is there a function that gets the root domain of a website? And then store it in variable? Link to comment https://forums.phpfreaks.com/topic/160302-get-root-url-and-store-it-in-a-variable/ Share on other sites More sharing options...
jxrd Posted May 30, 2009 Share Posted May 30, 2009 $_SERVER['SERVER_NAME']; Link to comment https://forums.phpfreaks.com/topic/160302-get-root-url-and-store-it-in-a-variable/#findComment-845953 Share on other sites More sharing options...
Bman900 Posted June 1, 2009 Author Share Posted June 1, 2009 Is there a way to basically get the location of a file minus the file name? Basically I want a code that will spit back the root of my files. For example if my files would be in root the code above: $_SERVER['SERVER_NAME']; would work just fine for a link, but what if some one puts those files in a folder like root>backup the link would not work. Link to comment https://forums.phpfreaks.com/topic/160302-get-root-url-and-store-it-in-a-variable/#findComment-846475 Share on other sites More sharing options...
jxrd Posted June 1, 2009 Share Posted June 1, 2009 dirname($_SERVER['REQUEST_URI']); Link to comment https://forums.phpfreaks.com/topic/160302-get-root-url-and-store-it-in-a-variable/#findComment-846772 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.