update("settings", Array('Value' => $_POST['userRegistration']), "`Setting` = 'userRegistration'"); $result['target_id'] = $_GET['id']; global $SITEBASE; require_once($SITEBASE . '/inc/settings.php'); $pageElements = settings(); $pageElements = array_merge(settings(), $result); $pageElements['permission'] = unserialize($_SESSION['ticket_user'])->getPermission(); // pass error and reload template accordingly helpers :: loadtemplate( 'settings', $pageElements); throw new SystemExit(); } else { //ERROR: user is not logged in header("Location: index.php"); throw new SystemExit(); } } catch (PDOException $e) { //go to error page or something, because can't access website db print_r($e); throw new SystemExit(); } }