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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="welcomeStyle.css">
<title>Inscription</title>
</head>
<body>
<img src="images/imageEncyclopedie.jpg" id="imageDebut">
<h1>Inscription</h1>
<a href="homePage.php">Retour</a><br><br>
<fieldset>
<legend>Vos coordonnées</legend>
<form method="post" action="userPortal.php">
<label for="Nom">Nom</label> : <input name="nom"><br/><br/>
<label for="Prenom">Prénom</label> : <input type="name" name="prenom"><br/><br/>
<label for="mail">Adresse mail</label> : <input type="email"><br><br>
<label for="numRue">Numéro de rue</label> : <input type="name" name="numRue">
<label for="nomRue">Nom de rue</label> : <input type="name" name="nomRue">
<label for="Ville">Ville</label> : <input type="name" name="ville">
<label for="codePostal">Code postal</label> : <input type="number" min="1" max="99"><br/><br/>
<label for="dateNaissance">Date de naissance</label> : <input type="date"/><br><br>
<label for="statut">Statut</label> : <select name="statut" id="situ">
<option value="etudiant">Etudiant</option>
<option value="passionné">Passionné</option>
<option value="professionnel">Professionnel</option>
</select>
</form>
</fieldset>
<br><br><br>
<fieldset>
<legend>Vos identifiants</legend>
<form action="userPortal.php" method="post">
<label for="pseudo">Pseudo</label> : <input type="name" name="pseudo"><br><br>
<label for="mot_de_passe">Mot de passe</label> : <input type="password" name="mot_de_passe">
</fieldset>
<br>
<input type="submit" value="S'inscrire">
</form>
<?php
try {
//ON SE CONNECTE A MYSQL
$bdd = new PDO('mysql:host=localhost;dbname=testsiteinfo;charset=utf8', 'root', '');
} catch (Exception $e) {
//EN CAS D'ERREUR, ON ARRETE TOUT ET ON AFFICHE UN MESSAGE D'ERREUR
die('Erreur : ' . $e->getMessage());
}
$req = $bdd->prepare('INSERT INTO user(pseudo, Nom, Prenom, mail, numRue, nomRue, Ville, codePostal, dateNaissance, statut) VALUES(:pseudo, :Nom, Prenom, :mail, :numRue, :nomRue, :Ville, :codePostal, :dateNaissance, :statut)');
$pseudo = ' ';
$nom = ' ';
$prenom = ' ';
$mail = ' ';
$numRue = ' ';
$nomRue = ' ';
$Ville = ' ';
$codePostal = ' ';
$dateNaissance = ' ';
$statut = ' ';
$req->execute(array(
'pseudo' => $pseudo,
'Nom' => $nom,
'Prenom' => $prenom,
'mail' => $mail,
'numRue' => $numRue,
'nomRue' => $nomRue,
'Ville' => $Ville,
'codePostal' => $codePostal,
'dateNaissance' => $dateNaissance,
'statut' => $statut
));
?>
</body>
</html> |
Partager