function newClient() { $results = array(); $results['pageTitle'] = "Nuovo cliente"; $results['formAction'] = "newClient"; if (isset($_POST['saveChanges'])) { $client = new client(); $client->storeFormValues($_POST); $client->insert(); header("Location: admin.php?action=listClients&status=changesSaved"); } elseif (isset($_POST['cancel'])) { // User has cancelled their edits: return to the article list header("Location: admin.php"); } else { // User has not posted the article edit form yet: display the form $results['client'] = new client(); require TEMPLATE_PATH . "/admin/editClient.php"; } }