Update add_client.php

This commit is contained in:
jakani24
2024-02-17 10:39:44 +01:00
parent a7df24a409
commit 3d2b5f03e1

View File

@@ -88,9 +88,14 @@ include "../../../config.php";
// Convert the random bytes to hexadecimal // Convert the random bytes to hexadecimal
$apikey = bin2hex($random_bytes); $apikey = bin2hex($random_bytes);
echo($cert); $stmt = $conn->prepare("INSERT INTO secrets (machine_id, cert) VALUES (?, ?)");
echo("<br>"); $stmt->bind_param("ss", $machineid, $cert);
echo($apikey); $stmt->execute();
$stmt->close();
$stmt = $conn->prepare("INSERT INTO api (machine_id, apikey) VALUES (?, ?)");
$stmt->bind_param("ss", $machineid, $apikey);
$stmt->execute();
$stmt->close();
} }
?> ?>
</div> </div>