> I don't know that you can "include" a file from a folder above the htdocs folder.
You can, indeed it's necessary for hiding connection details. Here's one way to do it, assuming you develop under Apache on an offsite devel machine, that you deploy on a standard *Nix hosting server, and of course that your code has to run seamlessly in both environments:
1. On your local server create the folder apache/includes for your include files. On your hosting server, create the includes folder in the folder just below public_html.
2. Assuming your include file is called myincfile.php, start your web pages with code like this ...
$host = ( isset( $_SERVER['HTTP_HOST'] )) ? $_SERVER['HTTP_HOST'] : "localhost";
if( $host=='localhost' ) {
$incfile = "c:/apache/includes/myincfile.php";
}
else {
$docroot = $_SERVER["DOCUMENT_ROOT"];
$home = substr( $docroot, 0, stripos( $docroot, "/public_html" ));
$incfile = "$home/includes/myincfile.php";
}
require_once( $incfile );