There is an alternate approach also that usually works better for me. It has its own peculiararities and works better if you are using a wrapper page with includes to encapsulate all you pages, but it sure makes it easier to pass values to a page.:
if ($submit) {
//do some actions and so on...
include "index.php";
} else {
//display form
}