hi,
looks like a variable scope problem.
in php, (user defined) variables declared outside functions are unknown to the functions unless
- they are passed as a parameter to the function, or
- they are declared global WITHIN the function
the latter is a very php specific behaviour.
[exception: some system variables as $_SERVER which are really global]
if you place the require('common.inc') within each function, thats just as good as if you pasted the variable declarationss/assignments into each function - so the values are there, as LOCAL variables (only known to the function).
a better way:
if your function uses (e.g.) $DBNAME, place
global $DBNAME;
inside the function, and the one "outside" variable is known. (but only in this one function where you've set it global).
hth,
matto