One easy way for this is what I call a "router" page. This page is just a post page, that has a case for each function you need. So say you have it post that form data, it will post to routerpage.php?id=x
where x is your switch statement
then, BEFORE anything is written to the page, I have it do all the functions it needs to do and I create 2 variables.
$responseMessage and $header
header contains the url, and response message is just a message I give after you posted...saying, hey that was wrong, or succeeded, you'll be redirected to $header, click here if you wish not to wait....
heres an example of my code for after the switch (when you write to the body)
HTML Code:
<html>
<head>
<meta http-equiv="refresh" content="3; url=<?php echo $header;?>"/>
</head>
<body>
<table height="50%" align="center">
<tr>
<td valign="bottom">
<?php echo $responseMessage;?>
<br /><br /> Please wait while we transfer you.... <br /><br />
<a href="<?php echo $header;?>">(Or click here if you wish not to wait)</a>
</td>
</tr>
</table>
</body>
</html>
This way, after you execute all the db commands, or anything you need to do, it goes down to the body, and you give the reponse message, and it automatically redirects to the $header url.
OFC you could always just skip the 3 second part and automatically forward them to the page you want them to be at.
Any questions, just ask, Ill be glad to assist as best I can.