Your suggestions were very helpful, especially turning on the error logging.
Here is where I'm at now:
Files in use:
My include statements in /main/page.php:
All the fuctions I call from dblib.inc work great, however, I have only a
single function in userlib.inc and it generates an error. The error I get
Fatal error: Call to undefined function: cleansession()
Here is the file userlib.inc:
session_register( "session" );
function cleanSession( $id, $login, $pass )
$session[id] = $id;
$session[login] = $login;
$session[password] = $pass;
$session[logged_in] = true;
Lastly, if I paste the above function into page.php (without the
session_start and session_register lines) it works fine. I've tried giving
the function a different name, changing case, all sorts of stuff. I've
tried renaming it to userlib.php and I've opened the file directly in my
browser with the error_reporting(2039); at the top and no error messages,
yet it is as if the file never gets included. I've tried including ONLY
userlib.inc and pasting all the dblib.inc functions into page.php (to rule
out dblib.inc screwing things up) and still I get the error.
I am truly confounded at this point. Thanks for any suggestions you have.
I think I am almost out of "Include Statement Hell". ;-)
"Jonathan Hilgeman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > So, maybe this is the question. Can you include a file from
> > /main/page.php by using a path of /includes/dblib.inc?
> Probably not. PHP can "see" the whole filesystem, not just the area that
> limited to your account. So, when you try to include "/includes/dblib.inc"
> it is trying to go down to the SYSTEM root and open up a subdirectory
> includes and get the file dblib.inc inside it.
> If you copy the dblib.inc to the same directory as page.php, you should
> have to say:
> However, if you have this layout:
> Then page.php would have to say:
> Which would go back one directory, THEN into the includes subdirectory,
> then it could find dblib.inc
> I would definitely add:
> ...to the top of your page.php code to see if you can pick up any errors.
> Also, check your error log if you have one (contact your hosting company
> you're not sure).
> I would definitely try to solve this the normal way by finding the problem
> with the paths rather than trying to screw with your php.ini or httpd.conf
> file - otherwise you'll have a script that might not work if you ever have
> to move your scripts or copy them to a development server or something.
> - Jonathan
> -----Original Message-----
> From: Brad Melendy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 7:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-DB] include() statement hell!
> Thanks Jonathan,
> I'm trying to include a file /includes/dblib.inc from /main/page.php. In
> /main/page.php I use include("includes/dblib.inc");. When that didn't
> I tried copying the file to /main/ and including it there and that didn't
> work either. Finally, I tried adding a specific path to the php.ini file
> for includes_path and put the files there and that worked. Then I went
> changed the php.ini file to remove the reference (still trying to get it
> work the way I THINK it should) and then it WORKED! But ONLY from within
> /main/. Each time I make these changes, I am making a matching change in
> the actual include() statement at the top of /main/page.php and I am
> restarting apache each time I change php.ini.
> So, maybe this is the question. Can you include a file from
> by using a path of /includes/dblib.inc?
> dblib.inc has functions that do connections and queries to a mysql
> Even stranger yet, is that I have one other include file called
> that has authentication related session functions. Well, that hasn't
> at all no matter what, unless I put the functions in /includes/userlib.inc
> directly into the file /main/page.php. Once there, all the functions work
> fine. Otherwise, the only error messages I get are regarding unknown
> functions being referenced, yet, I never get an error that the include
> can't be found. It's all crazy to me.
> Currently, both of my include files are called directly with two lines
> They are both located in /main/ along side page.php which is calling them.
> They both seem to work this way, but as soon as I place them in /includes/
> and try to call them using:
> I get errors saying that the functions can't be found, however, no errors
> saying it can't find the include files??
> Lastly, even with both include files in /main/ I still have some strange
> problem with my userlib.inc file because the single function that is in
> there won't work unless the function is pasted directly into
> I think I've made this message way too long but I appreciate your help.
> I've got the page working reliably with the functions all pasted into
> page.php but not while including those functions. I just can't think of
> what could be making it difference. The functions are all the same, just
> running from an include file is a problem.
> Thanks again, just writing this up has helped to make more sense to me. I
> think the crux of the whole thing is the path. I'm using to including
> in ASP and those can be relative so something like ../includes/dblib.inc
> works great.
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php