-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinscriptioncompte.php
More file actions
84 lines (83 loc) · 3.51 KB
/
inscriptioncompte.php
File metadata and controls
84 lines (83 loc) · 3.51 KB
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
<?php
include("includes/pageentete.php");
//---------------- 1A : Affichage du formulaire avec les catégories
?>
<center>
<div class="p-3 mb-2 bg-primary text-white"><h3>Inscription</h3></div>
</center>
<div class="container">
<form method="get" action="inscriptioncompte.php">
<!--Mise en place des zones de textes-->
<div class="container">
<form>
<div class="form-row">
<div class="form-group col-md-4">
<label for="inputCity">Nom</label>
<input type="text" class="form-control" id="inputCity" name="txtnom">
</div>
<div class="form-group col-md-4">
<label for="inputCity">Prénom</label>
<input type="text" class="form-control" id="inputCity" name="txtprenom">
</div>
<div class="form-group col-md-4">
<label for="tel">Téléphone</label>
<input type="tel" placeholder="0123456789" class="form-control" id="inputCity" name="txttel" pattern="[0-9]{10}">
</div>
<div class="form-group col-md-6">
<label for="inputEmail4">Email</label>
<input type="email" class="form-control" id="inputEmail4" name="txtmail">
</div>
<div class="form-group col-md-6">
<label for="inputPassword4">Mot de passe</label>
<input type="password" class="form-control" id="inputPassword4" name="txtmdp">
</div>
<div class="form-group col-md-6">
<label for="inputCity">Adresse 1</label>
<input type="text" class="form-control" id="inputCity" name="txtadr1">
</div>
<div class="form-group col-md-6">
<label for="inputZip">Adresse 2</label>
<input type="text" class="form-control" id="inputZip" name="txtadr2">
</div>
<div class="form-group col-md-6">
<label for="inputZip">Ville</label>
<input type="text" class="form-control" id="inputZip" name="txtville">
</div>
<div class="form-group col-md-6">
<label for="inputZip">Code Postal</label>
<input type="text" placeholder="69590" class="form-control" id="inputZip" name="txtcp" pattern="[0-9]{5}">
</div>
</div>
<button type="submit" class="btn btn-primary" name="btnajouter">S'incrire</button>
</form>
</div>
<br>
</form>
<!--Ouverture du php-->
<?php
require_once("connexion.inc.php");
if(isset($_GET["btnajouter"])==true)
{
// Création du compte
$reqresult = $cnn -> prepare("insert into client (clinom , cliprenom, cliadr1, cliadr2, clicp, cliville, clitel, climail, climdp, magnum) values (:clinom, :cliprenom, :cliadr1, :cliadr2, :clicp, :cliville, :clitel, :climail, :climdp, 3)");
$reqresult->bindParam(':clinom',$_GET["txtnom"],PDO::PARAM_STR);
$reqresult->bindParam(':cliprenom',$_GET["txtprenom"],PDO::PARAM_STR);
$reqresult->bindParam(':cliadr1',$_GET["txtadr1"],PDO::PARAM_STR);
$reqresult->bindParam(':cliadr2',$_GET["txtadr2"],PDO::PARAM_STR);
$reqresult->bindParam(':clicp',$_GET["txtcp"],PDO::PARAM_STR);
$reqresult->bindParam(':cliville',$_GET["txtville"],PDO::PARAM_STR);
$reqresult->bindParam(':clitel',$_GET["txttel"],PDO::PARAM_STR);
$reqresult->bindParam(':climail',$_GET["txtmail"],PDO::PARAM_STR);
$reqresult->bindParam(':climdp',$_GET["txtmdp"],PDO::PARAM_STR);
$res=$reqresult -> execute();
$reqresult -> closeCursor();
?>
<div class="p-3 mb-2 bg-light text-dark">Votre compte a été créé ! Redirection automatique à la page de connexion dans 3 secondes</div>
<?php
header("Refresh: 3; URL=connexioncompte.php");
}
?>
</center>
</div>
</body>
</html><!--echo("<br> Votre compte a été créé ! Redirection automatique à la page de connexion dans 3 secondes");-->