Jump to content

includes


hchsk

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/158185-includes/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/158185-includes/#findComment-834406
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/158185-includes/#findComment-834407
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.