Skip to content
Snippets Groups Projects
Commit a6fd5966 authored by vautrin33u's avatar vautrin33u
Browse files

debut git

parents
No related branches found
No related tags found
1 merge request!1Master
Showing with 119 additions and 0 deletions
/.vscode/
This diff is collapsed.
<?php // Gestion de l'inscription
session_start(); // début session
/**
* Génère un formulaire d'inscription
*/
function formInscription(){
$mysqli=mysqli_connect('127.0.0.1', 'root', '') or die("Erreur de connexion");
if (!$mysqli) {
die("Connection failed: " . mysqli_connect_error());
}
$describe = $mysqli->query('describe Boissons.utilisateurs;');
if ($describe->num_rows > 0) {
$form = '<h1> Inscription </h1>';
$form .= '<form method="post" id="inscription">';
while ($row = $describe->fetch_assoc()) {
if ($row["Field"] != "user_id") {
$form .= "<label for='" . $row["Field"] . "'>";
switch ($row["Field"]){
case "nom":
$form.= "Nom : ";
break;
case "prenom":
$form.= "Prénom : ";
break;
case "pseudo":
$form.= "Pseudo : ";
$form .= "</label> <input type='text' required='true' name='" . $row["Field"] . "' > </br>";
break;
case "password":
$form.= "Mot de passe : ";
$form .= "</label> <input type='text' required='true' name='" . $row["Field"] . "' > </br>";
break;
case "sexe":
$form.= "Sexe : </label>";
$form .= "<input type='radio' id='Homme' name='" . $row["Field"] . "' > <label for='Homme'>Homme </label>";
$form .= "<input type='radio' id='Femme' name='" . $row["Field"] . "' > <label for='Femme'>Femme </label>";
$form .= "</br>";
break;
case "email":
$form.= "E-mail : ";
break;
}
if ($row["Field"] != "sexe" && $row["Field"] != "pseudo" && $row["Field"] != "password"){
$form .= "</label> <input type='text' name='" . $row["Field"] . "' > </br>";
}
}
}
}
$form .= "<input type='submit' id='ok' value='Inscription'>";
$form .= "</br> <div id='explications'> </diw> </br> </form>";
return $form;
}
/**
* Génère un formulaire de connexion
*/
function formConnexion(){
$mysqli=mysqli_connect('127.0.0.1', 'root', '') or die("Erreur de connexion");
if (!$mysqli) {
die("Connection failed: " . mysqli_connect_error());
}
$describe = $mysqli->query('describe Boissons.utilisateurs;');
if ($describe->num_rows > 0) {
$form = '<h1> Connexion </h1>';
$form .= '<form method="post" id="connexion">';
while ($row = $describe->fetch_assoc()) {
switch ($row["Field"]){
case "pseudo":
$form .= "<label for='" . $row["Field"] . "'>";
$form.= "Pseudo : ";
$form .= "</label> <input type='text' required='true' name='" . $row["Field"] . "' > </br>";
break;
case "password":
$form .= "<label for='" . $row["Field"] . "'>";
$form.= "Mot de passe : ";
$form .= "</label> <input type='text' required='true' name='" . $row["Field"] . "' > </br>";
break;
}
}
$form .= "<input type='submit' id='ok' value='Connexion'>";
$form .= "</br> <div id='explications'> </diw> </br></form>";
}
return $form;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Inscription</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<?php
//include("install.php");
include("GestionUtilisateur.php");
?>
<script type="text/javascript" src="formulaire.js"> </script>
</head>
<body>
<?php
echo formInscription();
//echo formConnexion();
?>
<div id="infos"></div>
</body>
</html>
\ No newline at end of file
Photos/Black_velvet.jpg

45.4 KiB

Photos/Bloody_mary.jpg

5.07 KiB

Photos/Bora_bora.jpg

4.84 KiB

Photos/Builder.jpg

65.1 KiB

Photos/Caipirinha.jpg

9.21 KiB

Photos/Coconut_kiss.jpg

38.7 KiB

Photos/Cuba_libre.jpg

25.9 KiB

Photos/Frosty_lime.jpg

2.68 KiB

Photos/Le_vandetta.jpg

2.42 KiB

Photos/Margarita.jpg

32.9 KiB

Photos/Mojito.jpg

9.5 KiB

Photos/Pina_colada.jpg

16.1 KiB

Photos/Raifortissimo.jpg

4.21 KiB

Photos/Sangria_sans_alcool.jpg

5.79 KiB

Photos/Screwdriver.jpg

23 KiB

Photos/Shoot_up.jpg

1.53 KiB

0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment