mirror of
https://codeberg.org/ThisIsMiseryy/techstore
synced 2026-05-14 14:52:04 +00:00
Aggiunta logica registrazione utente
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
<?php
|
||||||
|
include 'db_conf.php';
|
||||||
|
?>
|
||||||
|
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="it">
|
<html lang="it">
|
||||||
<head>
|
<head>
|
||||||
@@ -7,6 +11,26 @@
|
|||||||
<link rel="stylesheet" href="style.css">
|
<link rel="stylesheet" href="style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
<?php
|
||||||
|
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||||
|
$sql = "INSERT INTO Users (Name, Surname, Email, Password) VALUES (?, ?, ?, ?)";
|
||||||
|
if($stmt = $conn->prepare($sql)){
|
||||||
|
$stmt->bind_param("ssss", $name, $surname, $email, $password);
|
||||||
|
|
||||||
|
$name = $_POST['name'];
|
||||||
|
$surname = $_POST['surname'];
|
||||||
|
$email = $_POST['email'];
|
||||||
|
$password = password_hash($_POST['password'], PASSWORD_DEFAULT);
|
||||||
|
$stmt->execute();
|
||||||
|
|
||||||
|
echo "<p style='color: green; text-align: center;'>Registrazione avvenuta con successo! <a href=\"login.php\">Accedi</a></p>";
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
echo "Errore: " . $conn->error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<form action="" method="POST">
|
<form action="" method="POST">
|
||||||
<h2>Registrazione</h2>
|
<h2>Registrazione</h2>
|
||||||
<label for="name">Nome:</label>
|
<label for="name">Nome:</label>
|
||||||
|
|||||||
Reference in New Issue
Block a user