Jump to content

Archived

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

xcite18

include. help. ( might be simple answer )

Recommended Posts

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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

×

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.