From 088816c1005f5edca5a95a54736dd9d886fcc32f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ebbe=20Ba=C3=9F?= Date: Sat, 17 Feb 2024 02:18:12 +0100 Subject: [PATCH] added update process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ebbe Baß --- server/web/update_settings.php | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/server/web/update_settings.php b/server/web/update_settings.php index e69de29..a8df8cf 100644 --- a/server/web/update_settings.php +++ b/server/web/update_settings.php @@ -0,0 +1,49 @@ +connect_error) { + die("Connection failed: " . $conn->connect_error); + } + +// Check if the form is submitted +if ($_SERVER["REQUEST_METHOD"] == "POST") { + // Get the form data + $macAddress = $_POST['macAddress']; + $dmxAddress = $_POST['dmxAddress']; + $universe = $_POST['universe']; + + $update_query = "UPDATE tubes SET dmx_address = '$dmxAddress', universe = '$universe' WHERE mac_address = '$macAddress'"; + + $conn->close(); +} +?> + + + + + + + + + + +
+

Update Settings

+ query($update_query) === TRUE) { + header("Location: ".$_SERVER['SERVER_NAME']."/"); + exit(); + } else { + echo '

Error updating settings: ' . $conn->error . '

'; + } + ?> +
+ +