change: signup

This commit is contained in:
Don Bock 2023-01-18 09:51:43 +01:00
parent 66a9311cae
commit b93e0c8e5a

View File

@ -34,7 +34,12 @@ $app->get("/user/:id", function (array $req, Response $res) use ($db) {
$res->send("user " . $req["params"]["id"]); $res->send("user " . $req["params"]["id"]);
}); });
$app->post("/createuser", function (array $req, Response $res) use ($db) { $app->post("/createuser", function (array $req, Response $res) use ($db) {
$db->insert("utente", ["email" => "test@email.com", "parolaDordine" => "password", "nomeUtente" => "testuser"]); $newUsername = $req["body"]["username"];
$newPassword = $req["body"]["password"];
$newEmail = $req["body"]["email"];
// $db->insert("utente", ["email" => "test@email.com", "parolaDordine" => "password", "nomeUtente" => "testuser"]);
$db->insert("utente", ["email" => "$newEmail", "parolaDordine" => "$newPassword", "nomeUtente" => "$newUsername"]);
$res->send("user "); $res->send("user ");
}); });