Well now I see your problem dude.
Your common_headers() function doesn't know about your varibles.
You need to define the variables you want to use when you define the function.
so like you function declaration would read like this...
function commonHeader($phpself) { ...
Letting the function know that you intend to use a variable from the outside world.
Then it will work if you call it like this...
commonHeader($phpself);
That has nothing to do with includes but rather functions.
You have to let the function know about the variables you intend to use. Alternately you could keep it like it is and just add the line...
global $phpself;
in your function declaration. That will force the function to inherit the $phpself variable.
Sucks you took down your whole server for that.