Forum Moderators: coopster
Set within each of your script something like:
require_once($_SERVER['DOCUMENT_ROOT']."/conn_db.php");
as is from anywhere in your scripts and directory you use only one URI (no needs to change any URI)
Then conn_db (set at root level) might be for ex:
require_once ("/var/www/conn/my_conn.php");
where my_conn is your db conn script
If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be included using a URL (via HTTP or other supported wrapper
and they could easily use get_defined_vars() to see what they need to
In order to get source code one would need to include it directly (using os path). So one would only be able to see index.php source code if on the same server (i.e. just another account on shared server).
yes you can cross include on some hosts if they haven't taken precautions
yes you only get output from an included script but try including a file via http and then call get_defined_vars [php.net] and see what happens