Well, you don't have to put all the script in the index page, what most people do is to use the index page as a switch so it includes different files depending on the action.
Consider this:
$menu = $_GET['menu'];
switch ($menu) {
case 'menu1':
include 'header.php';
include 'myscript.php';
include 'footer.php';
break;
case 'menu2':
// do something else
break;
default:
// what else is there to do?
}