You cannot delete yourself.'; header("Location: " . $_SERVER['REQUEST_URI']); exit(); } $success = deleteUser($_POST['userId']); if ($success) { $_SESSION['message'] = ''; } else { $_SESSION['message'] = ''; } header("Location: " . $_SERVER['REQUEST_URI']); exit(); } $password = !empty($_POST['password']) ? $_POST['password'] : null; $_POST['is_admin'] = isset($_POST['is_admin']) ? 1 : 0; $success = updateUserDetails($_POST['userId'], $_POST['email'], $_POST['firstName'], $_POST['lastName'], $_POST['is_admin'], $password); if ($success) { $_SESSION['message'] = ''; } else { $_SESSION['message'] = ''; } header("Location: " . $_SERVER['REQUEST_URI']); exit(); } ?>