Jump to content


Photo

include. help. ( might be simple answer )


  • Please log in to reply
1 reply to this topic

#1 xcite18

xcite18
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 02 June 2006 - 10:46 PM

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



#2 nogray

nogray
  • Members
  • PipPipPip
  • Advanced Member
  • 930 posts
  • LocationSan Francisco CA

Posted 02 June 2006 - 11:30 PM

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

NoGray.com





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users