electricshoe Posted October 8, 2007 Share Posted October 8, 2007 I'm building an application that pulls in other applications in the document, and I'm having a bit of a file structure problem calling in classes with includes. I'm a huge noob with file structure and using classes. The problem exactly is that oscommerce is in a separate directory than the main script. The index builds out a file, which includes all of the oscommerce header stuff, then custom template things, and then includes the body of the oscommerce. When I run a simplified version of the script in the root folder of the oscommerce installation it works fine. But when I run oscommerce in a different folder and include the files into the script it breaks and gives me a "Call to a member function display_price() on a non-object in filepath/file.php on line 33" Is there anyway to get around this? Because I'm going to be cramming a lot of applications together in this script and I want each one to be in a separate folder and I include them into the script that runs in the root directory. Currently the file structure looks like this: root :: mainscript root/modules :: custom modules root/modules/include :: custom includes root/modules/store/ :: oscommerce root/modules/anyotherapp/ :: any other application i may want to include so the script references files in different folders and includes them all into the main page builder. What can I do, I'm completely clueless here and having a hard time pinning down a tutorial that covers this. Thanks in advance, I appreciate your help A LOT Quote Link to comment https://forums.phpfreaks.com/topic/72377-class-includes-returning-non-objects-file-structure-problem/ Share on other sites More sharing options...
electricshoe Posted October 9, 2007 Author Share Posted October 9, 2007 I figured out exactly what the problem is, the file includes are coming in through functions and this is destroying their ability to do classes. I'm gonna close this one and ask in the general php forum. Feel free to delete this post. Quote Link to comment https://forums.phpfreaks.com/topic/72377-class-includes-returning-non-objects-file-structure-problem/#findComment-365500 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.