Maybe I was not clear after all. Here it goes.
index.php consists of, say two functions.
function one() {
....
if ($foo != $foo2) {
switch to functionTwoBellow() // I think header() switch would be out of the question
since parameters been passed.
}
function two() {
...
}
Does this make any sense?