This isn't any more info...
First you forgot one ')' but that's a parse error:
if(is_file("./$g4")
{
include($g4);
}
should be
if(is_file("./$g4"))
{
include($g4);
}
ofcourse.
But why the include doesn't work i cannot see from here. Maybe you'll have to specify the path in the include: include("./$g4") but i cannot think of any reason for that. I obvious don't see any fault in the things you show me, so there must be an error somewhere else in your code. What's the actual error message??