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 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
| <!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link href="style.css" rel="stylesheet" type="text/css">
<!-- <link href="images/ico_anneau.png" rel="icon"> -->
<title>Projet Vélo - Lyçée Raymond POINCARE</title>
</head>
<body>
<?php include("Extension/header.php"); ?>
<div id = "inscription">
<h1>Formulaire d'inscription</h1>
<h2>Pour vous inscrire au projet, veuillez remplir les champs ci-dessous.</h2>
<form name="formulaire" method="post" action="">
<div id = "flex-formulaire">
<table class = "formulaire" align="center">
<tr>
<td class="colonne1">Nom :</td>
<td class="colonne2"><input name="nom" type="text" placeholder="NOM" maxlength="42" required></td>
</tr>
<tr>
<td class="colonne1">Prénom :</td>
<td class="colonne2"><input name="prenom" type="text" placeholder="Prénom" maxlength="42" required></td>
</tr>
<tr>
<td class="colonne1">Date de naissance :</td>
<td class="colonne2"><input name="datenaissance" type="date" required></td>
</tr>
<tr>
<td class="colonne1">Classe :</td>
<td class="colonne2">
<select name="classe" id="NiveauEtude">
<optgroup label="Collège">
<option>6ème</option>
<option>5ème</option>
<option>4ème</option>
<option>3ème</option>
</optgroup>
<optgroup label="Lycée">
<option>Seconde</option>
<option>Première</option>
<option>Terminale</option>
</optgroup>
<optgroup label="Etudes supérieurs">
<option>BTS 1ère année</option>
<option>BTS 2ème année</option>
</optgroup>
</select>
</td>
</tr>
<tr>
<td class="colonne1">Régime :</td>
<td class="colonne2">
<select name="regime" id="regime">
<option>Externe</option>
<option>Demi-pensionnaire</option>
<option>Interne</option>
</select>
</td>
</tr>
</table>
<table class = "formulaire" align="center">
<tr>
<td class="colonne1">Adresse :</td>
<td class="colonne2"><input name="adressepostale" type="text" placeholder="9 rue des patates" maxlength="100" required></td>
</tr>
<tr>
<td class="colonne1">Code postal :</td>
<td class="colonne2"><input name="codepostal" type="text" placeholder="55000" maxlength="5" required></td>
</tr>
<td class="colonne1">Ville :</td>
<td class="colonne2"><input name="ville" type="text" placeholder="Bar-Le-Duc" maxlength="50" required></td>
<tr>
<td class="colonne1">Adresse électronique :</td>
<td class="colonne2"><input name="email" type="email" placeholder="patates@gmail.com" maxlength="42" required></td>
</tr>
<tr>
<td class="colonne1">Identifiant pour le site :</td>
<td class="colonne2"><input name="idsite" type="text" placeholder="RoiPatateDu55" maxlength="42" required></td>
</tr>
</table>
</div>
<input id="SendButton" type="submit" name="envoi" value="Envoyer">
</form>
</div>
<div id="VALIDER" class="overlay">
<div class="popup">
<h2>Here Pop UP</h2>
<a class="close" href="#">×</a>
<div class="content">
Thank to pop me out of that button, but now im done so you can close this window.
</div>
</div>
</div>
<div id="ERREUR" class="overlay">
<div class="popup">
<h2>Here Pop UP</h2>
<a class="close" href="#">×</a>
<div class="content">
Thank to pop me out of that button, but now im done so you can close this window.
</div>
</div>
</div>
<?php
if (isset ($_POST['envoi'])) {
/* DECLARATION DONNEES */
$nom=$_POST['nom'];
$prenom=$_POST['prenom'];
$datenaissance=$_POST['datenaissance'];
$classe=$_POST['classe'];
$regime=$_POST['regime'];
$adressepostale=$_POST['adressepostale'];
$codepostal=$_POST['codepostal'];
$ville=$_POST['ville'];
$email=$_POST['email'];
$idsite=$_POST['idsite'];
$validation=0;
$distancedomiciles=23;
$mdpDefault="PATATEpatatePATATEpatatePATATE";
/* ------------------- */
/* CONNEXION SERVEUR MYSQL */
$serveur = "localhost";
$base = "velo";
$user = "stramarnard";
$pass = "etatap*55";
$mysqli = new mysqli($serveur, $user, $pass, $base);
/* ----------------------- */
/* EXECUTION DE COMMANDE SUR LE SERVEUR MYSQL */
$requete = "SELECT * FROM cyclistes WHERE identifiantweb='".$idsite."'";
$verification=$mysqli->query($requete);
if ($verification->num_rows == 0) {
if ($stmt = mysqli_prepare($mysqli, "INSERT INTO cyclistes (validation, nom, prenom, classe, regime, datedenaissance, adressepostale, codepostal, ville, adresseelectronique, identifiantweb, distancedomiciles, motdepasseweb) VALUES(?,?,?,?,?,?,?,?,?,?,?,?,?)")) {
$stmt->bind_param("sssssssssssss", $validation, $nom, $prenom, $classe, $regime, $datenaissance, $adressepostale, $codepostal, $ville, $email, $idsite, $distancedomiciles, $mdpDefault);
mysqli_stmt_execute($stmt);
header('Location: Inscription.php#VALIDER');
exit();
}
}
else {
header('Location: Inscription.php#ERREUR');
exit();
}
$mysqli->close();
/* ------------------------------------------ */
}
?>
<?php include("Extension/footer.php"); ?>
</body>
</html> |
Partager