public function addPhone() { $phone = array('id' => $_POST['identityId'], 'number' => $_POST['phoneNumber'], 'typeId' => $_POST['phoneType']); Phone::newPhone($phone); // Redirects are a stupid solution for this problem header('Location: ' . $_POST['path']); }