-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.php
More file actions
94 lines (69 loc) · 2.9 KB
/
mod.php
File metadata and controls
94 lines (69 loc) · 2.9 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
85
86
87
88
89
90
91
92
93
94
<?php
include_once('config.php');
$a = $_GET['$idi'];
$update = $pdo->prepare("SELECT*FROM etudiant WHERE idetudiant =$a ");
$update->execute();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CHAT APP</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
<section class="signup form">
<header>MODIFICATION ETUDIANT</header>
<form method="POST">
<?php foreach ($update as $row) : ?>
<div class="error-txt"></div>
<div class="name-details">
<div class="field input">
<label for="">Nom</label>
<input type="text" name="fname" value="<?php echo $row['nom'] ?>">
</div>
<div class="field input">
<label for="">Prenom</label>
<input type="text" name="lname" value="<?php echo $row['prenom'] ?>">
</div>
</div>
<div class="field input">
<label for="">Date de naissance</label>
<input type="" name="date" value="<?php echo $row['date_naissance'] ?>">
</div>
<div class="name-details">
<div class="field input">
<label for="">Email</label>
<input type="mail" name="email" value="<?php echo $row['email'] ?>">
</div>
<div class="field input">
<label for="">Numéro</label>
<input type="text" name="numero" value="<?php echo $row['numero'] ?>">
</div>
</div>
<div class=" field button">
<!-- <a href="edit.php?$idi='.$id.'"><button>Sauvegarder</button></a> -->
<input type="submit" name="send" value="Sauvegarder">
</div>
<?php endforeach ?>
</form>
</section>
</div>
<?php
include_once('config.php');
if (isset($_POST['send'])) {
$nom = $_POST['fname'];
$prenom = $_POST['lname'];
$dates = $_POST['date'];
$email = $_POST['email'];
$numero = $_POST['numero'];
$mod = $pdo->prepare("UPDATE etudiant SET nom='$nom',prenom='$prenom', date_naissance='$dates', email='$email', numero=$numero WHERE idetudiant=$a");
$mod->execute();
header("location:tableau.php");
}
?>
</body>
</html>