'cache', "debug" => true)); $configs = load_config_categorized(); $twig_vars = array('config' => $configs, "error" => $error, "message" => $message); echo $twig->render('config.html.twig', $twig_vars); } elseif ($_SERVER["REQUEST_METHOD"] == "POST") { foreach($_POST as $key => $value) { if (empty($value)) { header("location:config.php?error=emptyfields"); exit; } $keydb = str_replace('_', '.', $key); $stmt = $db->prepare("UPDATE config SET value = ? WHERE conf = ?"); $stmt->execute(array($value, $keydb)); } header("location:config.php?message=edited"); exit; } require_once 'include/finalize.inc.php';