LordShryku: your right... require/require_once should probably be used for things that are mandatory... however i don't think ive seen someone ever try to include() a file that may or may not be there...
a quick summary:
when successful include() and require() do exactly the same thing
when include() fails it throws a warning, which may simply be ignored, and the script continues to execute
when require() fails it throws a fatal error, and the scripts halts all processing
so LordShryku is right... you should probably change your include()s to require()s
Next item: bringing global variables into the function scope: i see you ahve run into and made your own solution.
you have created the getVariables.php file to include. this works perfectly, but right now this method is not too useful... only because it does not do any error correction. You do look to see if the variable is in $_GET but if it isn't you are taking no steps to fix it. Again your code works, but since this is the critique forum ill say this
so I would recommend, on failure of finding the wanted $_GET[var] that you either:
1) die and print an error message
2) set the wanted variable to a default value <prob not what you want to do>
3) return to where they came from to try again with the trick:
die(header("Location: [url]http://www.blah.com/[/url]"));
also if you took my advise and put one call in each file for $db.. that means you would have to bring that variable from the global to the local scope for each function you want to use it..
this is easliy done this way
$db = pg_connect("blah");
function blah () {
global $db;
}
<probably more critiques to come>