Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problems with include files when creating a page in a sub directory off of root.


eosmann

Recommended Posts

I have added logic to admin to define content pages in a sub folder or directory off the root directory but am having tons of problems getting the script to load properly because all the configure.php and application_top.php references are setup to only work with files in the root (base) directory and not under directories off the root. For instance www.yoursite.com/newpage.php loads find (of course) but www.yoursite.com/pages/newpage.php doesn't - application_top.php fails to process completely so I then changed the config to an absolute server directory where applicable but continue to run into problems getting everything to resolve properly and load nicely.

 

Has anyone done this and have a simply solution on how to handle this problem and get the application_top and configure files to load for both cases?

 

Thanks

Eric

Link to comment
Share on other sites

I'm not completely sure I understand your question excatly so this mite not help but...

application_top.php and configure.php are in the catalog/includes. Copy the includes folder and paste it in the same folder with the page you are working on. Or copy just application_top.php and configure.php and put them in a includes folder.

 

As I said I'm not excatly sure of the question I hope I'm not too far off base.

Thanks

Worldpar

Link to comment
Share on other sites

I think you are understanding correctly and that might work, will give it a try.

 

Currently my page(s) in the sub driectory has this ../ added to the path so it finds the file ie: include('../includes/application_top.php');

however I would like to find a single solution, changes to application_top and configure to avoid duplicating the files and causing more confusion when adding modules or making changes - my application_top currently has about 30% more code in it than the default store.

 

Currently my experiences with trying to get the application_top source to work in more than one driectory has ended in a mess because of all the include sub directory paths that are loaded from within, such as the language for instance and then finding none of the button images appear. If its not one thing its another and I am not sure what the best solution or path I should take is anymore.

 

Has anyone successful create sub driectory pages? It would appear it was never taken into consideration when designing the cart.

 

Thanks

Link to comment
Share on other sites

OK - if no one knows how to make the pages load from a sub directory using the application_top file then how about creating the file in the root programatically? Either creating it there or creating is in the pages directory and moving it. I obviously do not want to set the permission on the root to 777, so does any one have a solution that I can add to my admin code that will create the file or place the created file in the root directory - overwritting any file previously already there of the same name?

 

Thanks in advance!

Eric

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...