hchsk Posted May 14, 2009 Share Posted May 14, 2009 how can i include a .php file that needs to be executed and contains relative links, from a different folder, without that screwing up the relative links. (i say screwing up, it's doing what it's supposed to, but in this particular case is not what i want). can exec() be used to do this? i was confused by the php manual Quote Link to comment https://forums.phpfreaks.com/topic/158185-includes/ Share on other sites More sharing options...
Brian W Posted May 14, 2009 Share Posted May 14, 2009 let me get this right, your include file has links that are relative? When you include it, the links relativity is broken and you obviously can't have that. Right? Quote Link to comment https://forums.phpfreaks.com/topic/158185-includes/#findComment-834388 Share on other sites More sharing options...
hchsk Posted May 14, 2009 Author Share Posted May 14, 2009 right Quote Link to comment https://forums.phpfreaks.com/topic/158185-includes/#findComment-834400 Share on other sites More sharing options...
hchsk Posted May 14, 2009 Author Share Posted May 14, 2009 and why might i get this error message when i attempt an absolute url? a relative path works when i call the page itself, not from an include Warning: fopen(http://www.lowersouthlounge.com/teambonuscheck.txt) [function.fopen]: failed to open stream: HTTP wrapper does not support writeable connections in /home/.ibycusdryer/cyprinid/lowersouthlounge.com/scripts/report.php on line 39 Quote Link to comment https://forums.phpfreaks.com/topic/158185-includes/#findComment-834406 Share on other sites More sharing options...
.josh Posted May 14, 2009 Share Posted May 14, 2009 when you include a file that has relative links in it, the relative paths become relative to the file that is including that included file. as far as the warning: when you use a full url like that, fopen attempts to open it via http protocol, and apparently your server is not setup to allow that (or it could be outside a publicly accessible folder). make the links in the included file relative to the file that is including the included file. Quote Link to comment https://forums.phpfreaks.com/topic/158185-includes/#findComment-834407 Share on other sites More sharing options...
jackpf Posted May 14, 2009 Share Posted May 14, 2009 Or you can use the document_root as an absolute path. Quote Link to comment https://forums.phpfreaks.com/topic/158185-includes/#findComment-834416 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.