xcite18 Posted June 2, 2006 Share Posted June 2, 2006 ill try to word this as best as i can, im using WP as my main site, and i wanna include another index.php WITHIN my WP index. so im using a line simliar to <?php include('../shop/index.php'); ?>my problem is that inside the shop folder, the rest of the files that are associated with index.php are trying to access their files within the local folder ( example: ('shop/sidebar.php') ) so I get errors on the WP saying, files and folders cant be found..is there a way to Include the shop/index.php, but have it not get errors.. basically.. having the include continously grab files from '../shop' location instead of just getting index.php from there, and trying to get the rest from 'shop'ok thats best i can word it i think, prolly confusing but i hope someone out there understands what im trying to do. thanks Quote Link to comment https://forums.phpfreaks.com/topic/11061-include-help-might-be-simple-answer/ Share on other sites More sharing options...
nogray Posted June 2, 2006 Share Posted June 2, 2006 your shop script uses relative paths, so it'll always look for the files in the same folder (not the shop folder) if you include it in the index.You can try to use file_get_contents('../shop/index.php') function which will run the '../shop/index.php' and return the HTML output.Otherwise, you'll need to change you shop files to use absolute paths Quote Link to comment https://forums.phpfreaks.com/topic/11061-include-help-might-be-simple-answer/#findComment-41331 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.