Jump to content

silly question...


mkosmosports

Recommended Posts

I want to use the include function on a file thats in the top-level directory of my site. I call on that from many sub-level directories, so whats the syntax to always call on that file, which is in the top-level directory?

 

Ive tried:

include ("../dbconnect.php");,

include ("/dbconnect.php");

 

Doesnt work... :P

Link to comment
Share on other sites

Yeah, that works. Thanks Ted Chou. I did have to enable URL file-access in the server configuration.

After reading up on php.net, turns out php doesnt handle including files from other directories very well. A user posted this question there:

 

"Why are the included files not looked up relative from the file that includes them and then in the include path? This would be a behavior like in all other languages."

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.