Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Creating a "Link Exchange" in Sub-Directory


totenmaske

Recommended Posts

I'm fairly new to PHP (don't shoot me!) and osCommerce especially. I'm in the process of setting up a website for my wife to retail some gift items using osCommerce. Normally I code in straight HTML (HomeSite 5.0) so a lot of the PHP include stuff is tripping me up. What I'm trying to do is use ARELIS to create a link partners page in a sub-directory. I've uploaded a test page (index.php) in a sub called "directory" but I'm getting all kinds of errors

 

Warning: main(includes/configure.php): failed to open stream: No such file or directory in /home/domain/public_html/includes/application_top.php on line 29

 

Fatal error: main(): Failed opening required 'includes/configure.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/domain/public_html/includes/application_top.php on line 29

 

I want to mimic the look and feel of the rest of the osCommerce site...so how do I map the includes to work correctly from a sub?

 

Stan

Link to comment
Share on other sites

I'm fairly new to PHP (don't shoot me!) and osCommerce especially.  I'm in the process of setting up a website for my wife to retail some gift items using osCommerce.  Normally I code in straight HTML (HomeSite 5.0) so a lot of the PHP include stuff is tripping me up.  What I'm trying to do is use ARELIS to create a link partners page in a sub-directory.  I've uploaded a test page (index.php) in a sub called "directory" but I'm getting all kinds of errors

I want to mimic the look and feel of the rest of the osCommerce site...so how do I map the includes to work correctly from a sub?

 

Stan

Since you are in a sub-directory, you the needed files cannot be seen. You will need to add a ../ to cause the code to look up one level.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Jack,

 

Thanks for the reply. I thought of adding the ../ but I'm still getting errors. I'm going to try something simple first like seeing if I can get the header by itself to display on the page.

 

But you agree it should be able to be done?

Link to comment
Share on other sites

OK...tried something simple

<link rel="stylesheet" type="text/css" href="../stylesheet.php">

 

<?php require('../includes/header.php'); ?>

 

got this

Fatal error: Call to a member function on a non-object in /home/enchant/public_html/includes/header.php on line 58

 

...and I though this was going to be easy like SSI!

Link to comment
Share on other sites

Sorry, but on thinking about this I don't think you can do it, at least not easily. The problem is that when you include a file like application_top, it has other includes that don't inherit the relative path. You could go through all of the files that are called in your code and change any include/require to go up one level. There is also a contribution (quite a few actually) here that says it will allow you to do what you want. I don't have anymore ideas at the moment though.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

well... here is what I did to create a page that had the same look as the rest of the site...

 

if I forget something please somone correct me:

 

I used the same principle of creating a new info box....

I copied and renamed a clean page of privacy.php in /catalog and in language/english and catalog/includes/boxes ..before It was changed...

 

I then adjusted the files ..... I took a look at the logical flow of the files and ....just got it to work with some trial and error :thumbsup:

 

:::Edited:::

 

and renamed the files to the new name of course :P

Link to comment
Share on other sites

Yes, there is nothing wrong with creating files like this in the root directory as you have done. But I though you wanted it in a sub-directory? Also, if you are using privacy.php as a guide to create a page, it doesn't have a reference in boxes/ so I'm not sure what you changed there but it was probably not needed. See my PageMaker contrtbution in my signature if you want a quick and easy way to generate new pages.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Yes, there is nothing wrong with creating files like this in the root directory as you have done. But I though you wanted it in a sub-directory?

 

OOOPS. :P Not me..but person who started this thread....

 

Also, if you are using privacy.php as a guide to create a page, it doesn't have a reference in boxes/ so I'm not sure what you changed there but it was probably not needed

Hmm...I took a look at my backup copy of a fresh install of osC....and your right? I dont remember why???I know I got some error.....????????? ...... So out of curiosity...I took out the new page in boxes...and got this error:

Warning: main(includes/boxes/scholars.php): failed to open stream: No such file or directory in /homepages/15/d113630270/htdocs/catalog/includes/column_left.php on line 18

Fatal error: main(): Failed opening required 'includes/boxes/scholars.php' (include_path='.:/usr/local/lib/php') in /homepages/15/d113630270/htdocs/catalog/includes/column_left.php on line 18

 

and as I was remember the whole thing..........I remember the error...but if it was privacy...where did I get the code from ..since there is not privacy.php in boxes.....and IT HIT ME....It wasnt privacy... it was " information.php " that I based everything on :blush:

 

See my PageMaker contrtbution in my signature if you want a quick and easy way to generate new pages.

 

Will do next time :thumbsup:

But I did have fun doing it on my own!!! This is FUN!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...