kks_krishna Posted July 15, 2007 Share Posted July 15, 2007 HI, I want to use the relative path in PHP include. see the following include code. For example if my site is www.site.com. Then I want to give the same type of URL every where so that it shd be taken from the relative path. What should be the correct way? include("/dlinks/files/LinkOperations.php"); Link to comment https://forums.phpfreaks.com/topic/60036-help-need-reagarding-relative-path-in-php-include/ Share on other sites More sharing options...
trq Posted July 15, 2007 Share Posted July 15, 2007 Hard to tell without seeing your directory structure but the leading / points to your root. Its usually much easier to use $_SERVER['DOCUMENT_ROOT'] and create an absolute path. Link to comment https://forums.phpfreaks.com/topic/60036-help-need-reagarding-relative-path-in-php-include/#findComment-298617 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.