Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8" />
- <title>Inscription</title>
- <link rel="stylesheet" href="css/bootstrap.css">
- <link rel="stylesheet" href="css/style.css">
- </head>
- <body id="page2">
- <?php
- // TEST PAGE COURANTE + INCLUSION MENU
- $currentPage = 'inscription.php';
- include("menu.php");
- ?>
- <!-- DEBUT FORMULAIRE INSCRIPTION -->
- <form method="post" action="inscription.php" >
- <div class="form-row">
- <div class="form-group col-md-6">
- <label for="inputCity" class="labelpage2">Nom</label>
- <input type="text" class="form-control" id="inputCity" placeholder="Nom" name="nom">
- </div>
- <div class="form-group col-md-4">
- <label for="inputZip" class="labelpage2">Prenom</label>
- <input type="text" class="form-control" id="inputZip" placeholder="Prenom" name="prenom">
- </div>
- <div class="form-group col-md-2">
- <label for="inputZip" class="labelpage2">Civilité</label>
- <input type="text" class="form-control" id="inputZip" placeholder="Mr, Mme" name="civilite">
- </div>
- </div>
- <div class="form-group col-md-12">
- <label for="inputState" class="labelpage2">Année de naissance</label>
- <select id="inputState" class="form-control" name="anneenaissance">
- <option disabled selected>Année de naissance</option>
- <?php
- for ($Annee=1917; $Annee <= 2016; $Annee++)
- {
- echo "<option>" . $Annee . "</option>";
- }
- ?>
- </select>
- </div>
- <div>
- <div class="form-group col-md-4">
- <label for="inputEmail4" class="labelpage2">Email</label>
- <input type="email" class="form-control" id="inputEmail4" placeholder="Email" name="mail">
- </div>
- </div>
- <div class="form-row">
- <div class="form-group col-md-4">
- <label for="inputEmail4" class="labelpage2">Mot de passe</label>
- <input type="password" class="form-control" id="inputPassword4" placeholder="Mot de passe" name="mdp">
- </div>
- </div>
- <div class="form-group">
- <label for="inputAddress" class="labelpage2">Adresse</label>
- <input type="text" class="form-control" id="inputAddress" placeholder="Adresse" name="adresse">
- </div>
- <div class="form-row">
- <div class="form-group col-md-6">
- <label for="inputCity" class="labelpage2">Ville</label>
- <input type="text" class="form-control" id="inputCity" placeholder="Ville" name="ville">
- </div>
- <div class="form-group col-md-4">
- <label for="inputZip" class="labelpage2">Code postal</label>
- <input type="text" class="form-control" id="inputZip" placeholder="CP" name="cp">
- </div>
- <div class="form-group col-md-2">
- <label for="inputZip" class="labelpage2">Téléphone</label>
- <input type="text" class="form-control" id="inputZip" placeholder="Téléphone" name="numerotel">
- </div>
- </div>
- <button type="submit" class="btn btn-primary" name="valider">Enregistrer</button>
- </form>
- <!-- FIN FORMULAIRE INSCRIPTION -->
- </body>
- </html>
- <?php
- // Connexion à la base de données
- try
- {
- $bdd = new PDO('mysql:host=localhost;dbname=orange;charset=utf8', 'root', '');
- }
- catch(Exception $e)
- {
- die('Erreur : '.$e->getMessage());
- }
- $req = $bdd->prepare('INSERT INTO adherent (Nom,Prenom,Civilite,DateNaiss,Mail,MotDePasse,Adresse,Ville,CP,Tel) VALUES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)');
- $req->execute(array($_POST['nom'], $_POST['prenom'], $_POST['civilite'], $_POST['anneenaissance'], $_POST['mail']
- , $_POST['mdp'], $_POST['adresse'], $_POST['ville'], $_POST['cp'], $_POST['numerotel']));
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement