name = $name; if ($_GET['pg']) { $this->process(); } else { echo 'default'; } } private function process() { echo $this->name; header('Location: '.$_SERVER['PHP_SELF']); exit; } } ?> Example