-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtambah.php
57 lines (40 loc) · 1.3 KB
/
tambah.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
<?php
require_once 'function.php';
if (isset($_POST['tambah'])) {
if (tambah($_POST) > 0) {
echo "<script>
alert('Data Berhasil ditambahkan');
document.location.href='index.php';
</script>";
} else {
echo "<script>
alert('Data Gagal ditambahkan');
document.location.href='index.php';
</script>";
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tambah Data Mahasiswa</title>
</head>
<body>
<h1>TAMBAH DAFTAR MAHASISWA</h1>
<form method="post" action="" enctype="multipart/form-data">
<label for="npm">Npm : </label>
<input type="number" name="npm" id="npm" placeholder="Masukan npm"><br>
<label for="nama">Nama : </label>
<input type="text" name="nama" id="nama" placeholder="Masukan nama"><br>
<label for="jurusan">Jurusan : </label>
<input type="text" name="jurusan" id="jurusan" placeholder="Masukan jurusan"><br>
<label for="email">Email : </label>
<input type="email" name="email" id="email" placeholder="Masukan jurusan"><br>
<label for="gambar">Gambar</label>
<input type="file" name="gambar" id="gambar"><br>
<button type="submit" name="tambah">Tambah</button>
</form>
</body>
</html>