Jump to content

include. help. ( might be simple answer )


xcite18

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

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.