I have tried to include some pages, which are severel directories below the current. However I dont know how to do this, I thought of using the full http:// URL but it didnt work.
This problem is simple and I just need someone to show me how to do it.
Thanks very much..
including files
Moderator: General Moderators
- aaronhall
- DevNet Resident
- Posts: 1040
- Joined: Tue Aug 13, 2002 5:10 pm
- Location: Back in Phoenix, missing the microbrews
- Contact:
When using functions that take a file path as an argument, a leading forward slash ("/") tells the function that you are referring to an absolute path as opposed to a relative one. When you pass a path without that forward slash, the function will try to look for a directory relative to the directory from which you are calling include(). An absolute path refers to a resource with respect to the root of the directory structure. You can find the root path to your account's root directory directory by calling $_SERVER['DOCUMENT_ROOT']. Start with that root path, and work your way to the file you are looking for (and don't forget the leading forward slash).