Jump to content

Recommended Posts

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  ;D

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.

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.