The thing that sucks about having to rely upon the php.ini file is that the you must use a particular folder for all your include files, even if you are using files for several different sites. It makes much more sense to be able to put your include files for a particular site in that site. It's easier for backups, moving the site and for shared hosting. I've gotten it to work partially using the folder defined in the php.ini file, but I want to be able to specifiy a folder from within the calling php file, which is how you should be able to do it.
...Brad "Dan Brunner" <[EMAIL PROTECTED]> wrote in message 000001c1d612$e94f0570$b3f7a718@doggy">news:000001c1d612$e94f0570$b3f7a718@doggy... > Has anybody told him to check his PHP.INI??? > > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 27, 2002 6:28 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: [PHP-DB] include() statement hell! > > #1. You may want to double-check the path where you're calling it from > in > case you're working with subdirectories. > > Let's saying you access a page at www.domain.com/page.php which calls > www.domain.com/includes/header.inc. > Then, header.inc includes the dblib.inc file at > www.domain.com/includes/dblib.inc. However, the include's base directory > will still be in page.php - the directory won't change to includes, so > for > header.inc to include dblib.inc, it has to say: > include("includes/dblib.inc"); > NOT > include("dblib.inc"); > Otherwise, it will be trying to include www.domain.com/dblib.inc because > the > page that started the whole chain reaction of includes is located at > www.domain.com/page.php > > #2. If you have error reporting turned off, and there is a parsing error > in > your files, the page may just die without giving a reason. Try turning > off > any error reporting and also access those include files like userlib.inc > directly in your web browser to see if PHP reports any errors. You may > need > to change the extension to something like userlib.inc.php for the web > server > to recognize the request correctly. > > #3. Please give us a little more detail on the errors you're getting > (any > specific messages would be nice). > > - Jonathan > > -----Original Message----- > From: Rick Emery [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 27, 2002 3:42 PM > To: 'Brad Melendy'; [EMAIL PROTECTED] > Subject: RE: [PHP-DB] include() statement hell! > > > did you start each include file with: > <?php > ?> > > If not, PHP treats the code within as straight text > > -----Original Message----- > From: Brad Melendy [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, March 27, 2002 5:03 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] include() statement hell! > > > Ok, I've spent some time reading the docs at php.net and I'm still > confused. > > After a couple hours, I have an include file working with a statement > like: > > include ("dblib.inc"); > > However, to add to my confusion, I've got a second include file > statement on > the next line: > > include ("userlib.inc"); > > And that doesn't work. > > Most crazy of all, if I just put the darn functions all in the PHP file > that > is trying to call the include files, everything works perfectly. > > So far I have my include_path line in the pho.ini file set to no value > since > I'm just using include files that exist in the same directory as the > calling > php file. this after I could NOT get the files to be properly > recognized > from their own include directory. As far as I'm concerned, you should > be > able to include a relative path with the included filename and have it > work. > Too bad that doesn't work in PHP. > > So, long story short, I'm about to give up on include statements and > just > copy and paste my functions all over the place. Does anyone have any > ideas > why this is so difficult for me? What am I missing? This stuff is easy > in > ASP but PHP is giving me serious heart-ache. :-( > > Thanks for any tips or suggestions. > > ....Brad > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php