change: signup
This commit is contained in:
parent
66a9311cae
commit
b93e0c8e5a
@ -34,7 +34,12 @@ $app->get("/user/:id", function (array $req, Response $res) use ($db) {
|
||||
$res->send("user " . $req["params"]["id"]);
|
||||
});
|
||||
$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 ");
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user