Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

New Directory


ivalea

Recommended Posts

Hello

 

I set up a new directory (catalog/m1/) and am trying to include this in the top of the file to make sure that visitors have logged in first:

 

  require(DIR_WS_INCLUDES . 'application_top.php');

 if (!tep_session_is_registered('customer_id')) {
$navigation->set_snapshot();
tep_redirect(tep_href_link(FILENAME_LOGIN, '', 'SSL'));
 }

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ACCOUNT);

 include('page1.html');
 require(DIR_WS_INCLUDES . 'application_bottom.php');

 

The problem is that I am getting this error when I run the file whether I'm logged in or not:

 

Warning: main(DIR_WS_INCLUDESapplication_top.php): failed to open stream: No such file or directory in /home/www/os.xephor.net/catalog/m1/player.php on line 13

 

Warning: main(DIR_WS_INCLUDESapplication_top.php): failed to open stream: No such file or directory in /home/www/os.xephor.net/catalog/m1/player.php on line 13

 

Fatal error: main(): Failed opening required 'DIR_WS_INCLUDESapplication_top.php' (include_path='.:/usr/local/lib/php') in /home/www/os.xephor.net/catalog/m1/player.php on line 13

 

Could this be because it's in another directory? I've so far had no problems creating new pages at the root using this same code. Any thoughts on how to fix this?

 

Thanks! :)

Link to comment
Share on other sites

I'm not sure that I understand you completely. I took catalog/configure.php and copied it to my new directory. So now I have a structure like this:

 

catalog/M1/index.php

catalog/M1/includes/

catalog/M1/includes/configure.php

catalog/M1/includes/application_top.php

catalog/M1/includes/filenames.php

catalog/M1/includes/functions/

catalog/M1/includes/functions/database.php

 

I changed all the paths in configure to reflect the new paths - still can't get it to work.

After setting up the new directory in this manner, whenever I went to /M1/index.php I would get this error:

 

Warning: main(includes/languages/english/FILENAME_M1_INDEX): failed to open stream: No such file or directory in /home/www/spbio.xephor.net/catalog/M1/index.php on line 9

 

Warning: main(includes/languages/english/FILENAME_M1_INDEX): failed to open stream: No such file or directory in /home/www/spbio.xephor.net/catalog/M1/index.php on line 9

 

Fatal error: main(): Failed opening required 'includes/languages/english/FILENAME_M1_INDEX' (include_path='.:/usr/local/lib/php') in /home/www/spbio.xephor.net/catalog/M1/index.php on line 9

 

FILENAME_M1_INDEX is defined /M1/filenames.php

 

I'm at a loss - isn't there an easier way to create a new directory accesible to logged in customers only?

Link to comment
Share on other sites

This could well be a permissions issue on your new directory, specifically that you don't have enough permissions on it. I think 644 is what should work, though I could be wrong.

Link to comment
Share on other sites

Thanks Bennstein - but that didn't work. Something odd happened when I did that though - the whole directory just disappeared!

 

Has anyone ever created another directory for oscommerce before?

Link to comment
Share on other sites

I would still check ALL your permissions (compare with others in your domain as well as those suggested in the osCommerce install guide). My top level directory actually has a permission of 775 just FYI.

 

'Tis only that every time I've encountered this error, it's been permissions related (assuming of course it's not the obvious issue of the file not actually being where it should be :)).

 

Btw, this bit in the error seems a little suspicious to me; it doesn't seem to have resolved the "DIR_WS_INCLUDES" bit almost like it is recognising it as a literal, not a constant (see bolded text):

 

Warning: main(DIR_WS_INCLUDESapplication_top.php): failed to open stream: No such file or directory in /home/www/os.xephor.net/catalog/m1/player.php on line 13
Link to comment
Share on other sites

Right - That's initially why I thought to copy over the included files - then I also tried typing in the path and that didn't work either. I've gone over all permissions and all seem to be set according to the docs - I'll go over them again though to double check.

 

Would you happen to know of any other way I could protect these without having the visitor login separately?

Thanks for helping me though - it's really appreciated! :)

Link to comment
Share on other sites

Would you happen to know of any other way I could protect these without having the visitor login separately?

Unfortunately, no. It seems like what you are doing is correct, logically at least, looking at the code. I'd say stick with it and try and nut out the error you're getting. I'm still thinking it'll end up being something simple. :)

 

Maybe someone else has some ideas; my reservoir of knowledge is a little low. :P

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...