-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathedit.php
More file actions
39 lines (35 loc) · 982 Bytes
/
edit.php
File metadata and controls
39 lines (35 loc) · 982 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
37
38
39
<html>
<head>
<title></title>
</head>
<body>
<?php
include 'koneksi.php';
$ID = $_GET['id'];
$sql = "SELECT * FROM user WHERE id =". $ID;
$result = mysqli_query($connect, $sql);
$row = mysqli_fetch_assoc($result);
?>
<form action="proses_edit.php" method="POST">
<!-- input nama -->
<input type="hidden" name="id" value="<?= $row['id'] ?>">
<label>Nama :
<input id="tambah_nama" type="text" name="nama" value="<?= $row['name'] ?>" />
</label>
<br>
<p>Jenis Kelamin :</p>
<label>Laki-laki
<input type="radio" name="gender" value="1" <?= ($row['gender']) ? "checked" : "" ; ?> />
</label>
<label>Perempuan
<input type="radio" name="gender" value="0" <?= ($row['gender']) ? "" : "checked" ; ?> />
</label>
<br>
<label>Alamat :
<textarea name="alamat"><?= $row['address'] ?></textarea>
</label>
<br>
<button type="submit">Edit Data</button>
</form>
</body>
</html>