fixed con close

Signed-off-by: Ebbe Baß <ebbe.bass>
main
Ebbe Baß 2024-02-17 02:19:37 +01:00
parent 088816c100
commit bcd81120e9
1 changed files with 3 additions and 4 deletions

View File

@ -18,10 +18,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
$macAddress = $_POST['macAddress']; $macAddress = $_POST['macAddress'];
$dmxAddress = $_POST['dmxAddress']; $dmxAddress = $_POST['dmxAddress'];
$universe = $_POST['universe']; $universe = $_POST['universe'];
$update_query = "UPDATE tubes SET dmx_address = '$dmxAddress', universe = '$universe' WHERE mac_address = '$macAddress'"; $update_query = "UPDATE tubes SET dmx_address = '$dmxAddress', universe = '$universe' WHERE mac_address = '$macAddress'";
$conn->close();
} }
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
@ -35,13 +33,14 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
</head> </head>
<body class="d-flex align-items-center justify-content-center" style="min-height: 100vh;"> <body class="d-flex align-items-center justify-content-center" style="min-height: 100vh;">
<div class="container"> <div class="container">
<h1 class="mb-4 text-center">Update Settings</h1>
<?php <?php
if ($conn->query($update_query) === TRUE) { if ($conn->query($update_query) === TRUE) {
header("Location: ".$_SERVER['SERVER_NAME']."/"); header("Location: ".$_SERVER['SERVER_NAME']."/");
$conn->close();
exit(); exit();
} else { } else {
echo '<p class="text-danger">Error updating settings: ' . $conn->error . '</p>'; echo '<p class="text-danger">Error updating settings: ' . $conn->error . '</p>';
$conn->close();
} }
?> ?>
</div> </div>