prepare($sql); $stmt->execute([ ':clave' => $template_name, ':valor' => $template_content ]); // Redirect back to configuration page with a success message header('Location: configuracion.php?success=1'); exit; } catch (PDOException $e) { // Handle DB error header('Location: configuracion.php?error=db'); exit; } } else { // Handle empty fields header('Location: configuracion.php?error=empty'); exit; } } else { // Redirect if not a POST request header('Location: configuracion.php'); exit; } ?>