-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinsert.php
More file actions
36 lines (29 loc) · 947 Bytes
/
insert.php
File metadata and controls
36 lines (29 loc) · 947 Bytes
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
<?php
include_once('config.php');
if(isset($_POST['envoyer'])){
$nom=$_POST['fname'];
$prenom=$_POST['lname'];
$dates=$_POST['date'];
$email=$_POST['email'];
$numero = $_POST['numero'];
$mdp1 = $_POST['password1'];
$mdp2 = $_POST['password2'];
if($mdp1==$mdp2){
$req=$pdo->prepare("INSERT INTO etudiant(nom,prenom,date_naissance,email,numero,mdp)
VALUES(:nom,:prenom,:dates,:email,:numero,:mdp1)");
$result= $req->execute([
'nom' => $nom,
'prenom' => $prenom,
'dates' => $dates,
'email' => $email,
'numero' => $numero,
'mdp1' => $mdp1,
]);
if($result){
header("location:tableau.php");
}else{
echo"échec";
}
}
}
?>