pureplayer Posted January 10, 2007 Share Posted January 10, 2007 Hi, I don't know much about PHP but I have this include thats giving me trouble.<? include("home/www/url.com/dynamicpoll/poll.php"); ?>the "/url.com/" section is my domain name i'm using on a free webserver and my files are locted in there. I think this part is giving me errors.any help will be appreciatedthanks Link to comment https://forums.phpfreaks.com/topic/33633-relative-path-help/ Share on other sites More sharing options...
redbullmarky Posted January 10, 2007 Share Posted January 10, 2007 unless you're in the very root of the server, then 'home/www/url.com/dynamicpoll/poll.php' will try and first find a directory called 'home' in the CURRENT directory.try a prepending slash:<? include("[b]/[/b]home/www/url.com/dynamicpoll/poll.php"); ?>failing that, try this[code]<?phpecho $_SERVER['DOCUMENT_ROOT'];?>[/code]and see how much of the full path it provides. then just append the rest to it, such as:[code]<?phpinclude($_SERVER['DOCUMENT_ROOT'] . '/dynamicpoll/poll.php');?>[/code]hope that helps Link to comment https://forums.phpfreaks.com/topic/33633-relative-path-help/#findComment-157585 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.