-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathubah.php
77 lines (56 loc) · 1.77 KB
/
ubah.php
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
<?php
require("function.php");
if( isset($_POST["submit"])) {
header("Location:index.php");
if( ubah($_POST) > 0 ) {
echo "Data berhasil diubah";
} else {
echo "gagal mengubah data";
}
}
$id = $_GET["id"];
$penduduk = query("SELECT * FROM datapenduduk WHERE No = $id")[0];
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
<title></title>
</head>
<body>
<div class="container-form">
<div class="form">
<div class="form-head">
<p>Edit data</p>
<p>masukkan data yang ingin anda ubah</p>
</div>
<div class="form-body" >
<form action="" method="post">
<input type="hidden" name="id" value="<?= $penduduk['No'] ?>">
<div class="form-isi">
<label for="nama">nama</label>
<input name="nama" type="text" id="nama" value="<?= $penduduk["Nama"] ?>">
</div>
<div class="form-isi">
<label for="umur">umur</label>
<input name="umur" type="text" id="umur" value="<?= $penduduk["Umur"] ?>">
</div>
<div class="form-isi">
<label for="gender">gender</label>
<input name="gender" type="text" id="gender" value="<?= $penduduk["Gender"] ?>">
</div>
<div class="form-isi">
<label for="pendidikan">pendidikan</label>
<input name="pendidikan" type="text" id="pendidikan" value="<?= $penduduk["Pendidikan"] ?>">
</div>
<button name="submit" class="submit" type="submit">Edit</button>
</form>
</div>
<div class="form-footer">
</div>
</div>
</div>
</body>
</html>