if(isset($_POST['submit'])) { // Code to process form data header("Location: success.php"); exit(); }
try { // Code that may throw an exception } catch(Exception $e) { header("Location: error.php"); exit(); }Package library: This feature is built into PHP itself and does not require any packages or libraries to be installed.