-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtambah-alternatif.php
44 lines (41 loc) · 1.02 KB
/
tambah-alternatif.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
<?php
include "header.php";
include "includes/config.php";
//code insert data
if ($_POST) {
$nm = $_POST['nm'];
$insert = mysqli_query($koneksi,"INSERT INTO alternatif
VALUES
('','$nm','')");
if ($insert) {
echo "<script>location.href='alternatif.php'</script>";
}else {
echo "Gagal";
}
}
?>
<br>
<div class="container">
<div class="row">
<div class="col-md-6 text-left">
<h4>Form Tambah Alternatif</h4>
</div>
<div class="col-md-6">
</div>
</div>
<br><br>
<form method="POST" action="">
<div class="form-group row">
<label for="nm" class="col-sm-2 col-form-label">Nama Alternatif</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="nm" name="nm">
</div>
</div>
<div class="form-group row">
<div class="col-sm-10">
<button type="submit" class="btn btn-primary">Tambah</button>
<button type="button" onclick="location.href='alternatif.php'" class="btn btn-success">Kembali</button>
</div>
</div>
</form>
</div>