1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
| <?php
$donee=[];
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<title>Titre</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Inscription</h1>
<form method="post">
<div id="champ_nom">
<label for="name">Nom :</label><input type="text" name="name" size="10px" required>
</div>
<div id="champ_prenom">
<label for="prenom">Prenom :</label><input type="text" name="prenom" size="10px" required>
</div>
<label for="mail">e-mail :</label><div id="c"><input type="email" name="mail" required></div>
<div id="mdp">
<label for="mdp">Mot de passe :</label><input type="password" name="mdp" size="10px" required>
</div>
<button type="submit" name="env">Envoyer</button></br>
<p>Table des utilisateurs</p></br>
<?php
if(isset($_POST["env"])){
if(!empty($_POST["name"]) && !empty($_POST["prenom"]) && !empty($_POST["mail"]) && !empty($_POST["mdp"])){
array_push($donee,['nom'=>$_POST['name'],'prenom'=>$_POST['prenom'],'mail'=>$_POST['mail'],'mdp'=>$_POST['mdp']]);
}
}
foreach($donee as $i){
foreach($i as $cle => $valeur){
echo("<input type = 'hidden' name= '$cle' value= '$valeur>");
echo("$cle: $valeur<br>");
}
}
?>
</form>
</body>
</html> |
Partager