Well, first of all, I would recommend getting your included files out of your web directories so that this isn't an issue. But on to your variables....
if(ereg("include.php", $PHP_SELF)) {
header("Location: http://mymainsite.com");
} else {
//go on processing
}
Hope that helps,
Matt Wade
codewalkers.com