eeyipes Posted March 14, 2004 Share Posted March 14, 2004 Can anyone help me write a path to a file outside my root directory? Not sure what it should look like. Thanks! Link to comment Share on other sites More sharing options...
ptrau Posted March 15, 2004 Share Posted March 15, 2004 File System Path or Virtual URL? What are you trying to do? "Aliiiiive, it's alive, it's ALIIIIIIIIIIIIIVE!!!" Link to comment Share on other sites More sharing options...
eeyipes Posted March 15, 2004 Author Share Posted March 15, 2004 A system path, I think? Can you tell I'm a newbie? I'm trying to add a require for a php file outside my root directory , and I can't seem to get the path right. Whatever I put it keeps looking for it inside the directory - how do I get it to look outside? I have a file in my catalog and I'm trying to add a require to a file outside my "www" that I want to refer to if I can. Just a generic example might head me on the right path. Thanks! Link to comment Share on other sites More sharing options...
ptrau Posted March 15, 2004 Share Posted March 15, 2004 Can you just copy the file and put it in your osc directory? If not: require('http://yourwebsite.xxx/path/to/the/file.php'); "Aliiiiive, it's alive, it's ALIIIIIIIIIIIIIVE!!!" Link to comment Share on other sites More sharing options...
eeyipes Posted March 15, 2004 Author Share Posted March 15, 2004 I need to call on the file from both the admin and catalog side. If I put the file in the same directory on the catalog side and call on it as require('myfile.php'); it works perfectly. But if I try to call on it like this require('http://mysite/path/to/myfile.php'); I get this error Warning: main(http://mysite.biz/path/to/myfile.php): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found I've tried it with the "www" in there too ... what am I doing wrong? Link to comment Share on other sites More sharing options...
ptrau Posted March 15, 2004 Share Posted March 15, 2004 I answered the question like a newbie. Require and include statements are FS paths not virtual paths. Please ignore my previous post. Sorry. Going to bed. "Aliiiiive, it's alive, it's ALIIIIIIIIIIIIIVE!!!" Link to comment Share on other sites More sharing options...
AlanR Posted March 15, 2004 Share Posted March 15, 2004 Here's a couple wiki docs to study http://wiki.oscommerce.com/WarnSecurity http://wiki.oscommerce.com/helpHowtoRemoveSecurityWarnings The "security" part of the title is a little misleading. They both have good info on using relative linking. Local: Mac OS X 10.5.8 - Apache 2.2/php 5.3.0/MySQL 5.4.10 • Web Servers: Linux Tools: BBEdit, Coda, Versions (Subversion), Sequel Pro (db management) Link to comment Share on other sites More sharing options...
user99999999 Posted March 15, 2004 Share Posted March 15, 2004 If you put the file in catalog/includes Then it would be like so from catalog dir require('includes/myfile.php') And like so from admin. require('../catalog/includes/myfile.php') If you put the file in admin/catalog/includes Then it would be like so from catalog dir require('admin/includes/myfile.php') And like so from admin. require('includes/myfile.php') Usually you dont use 'http://' to require files on the local file system. Link to comment Share on other sites More sharing options...
eeyipes Posted March 15, 2004 Author Share Posted March 15, 2004 Thank you! It's amazing the obvious things you can't figure out when you've been fiddling with this junk too long! I need some sleep too! Got it working, so now I can. Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.