diff --git a/public/addPrinter.php b/public/addPrinter.php
deleted file mode 100644
index d8e0a04..0000000
--- a/public/addPrinter.php
+++ /dev/null
@@ -1,252 +0,0 @@
-
-
-
-
-
-
diff --git a/public/printerForm.php b/public/printerForm.php
new file mode 100644
index 0000000..83cd36a
--- /dev/null
+++ b/public/printerForm.php
@@ -0,0 +1,211 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
TOD Dashboard
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
User Settings
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/db.php b/src/db.php
index 8e1069e..45d8b3d 100644
--- a/src/db.php
+++ b/src/db.php
@@ -1,5 +1,5 @@
+
+
\ No newline at end of file
diff --git a/src/login.php b/src/login.php
index d205a52..8904eb1 100644
--- a/src/login.php
+++ b/src/login.php
@@ -1,6 +1,6 @@
'error', 'message' => 'All fields are required and IP must be valid.']);
+ exit;
+ }
+
+ try {
+ // Prepare SQL insert statement
+ $stmt = $pdo->prepare("
+ INSERT INTO bambuPrinters (printerName, printerIp, mqttPassword, serialNumber)
+ VALUES (:printerName, :printerIp, :mqttPassword, :serialNumber)
+ ");
+
+ // Execute the query with bound parameters
+ $stmt->execute([
+ ':printerName' => $printerName,
+ ':printerIp' => $printerIp,
+ ':mqttPassword' => $accessCode,
+ ':serialNumber' => $serialNumber
+ ]);
+
+ echo json_encode(['status' => 'success', 'message' => 'Printer successfully added!']);
+ } catch (PDOException $e) {
+ echo json_encode(['status' => 'error', 'message' => 'Error adding printer: ' . $e->getMessage()]);
+ }
+} else {
+ echo json_encode(['status' => 'error', 'message' => 'Invalid request method.']);
+}
+?>
diff --git a/template.php b/template.php
index 77018a2..33993bc 100644
--- a/template.php
+++ b/template.php
@@ -38,85 +38,7 @@
-
+