Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include 'lib/library.php';
- if ($_SERVER ['REQUEST_METHOD'] == 'POST') {
- $nis = $_POST['nis'];
- $nama_lengkap = $_POST['nama'];
- $gender = $_POST['gender'];
- $kelas = $_POST['kelas'];
- $jurusan = $_POST['jurusan'];
- $alamat = $_POST['alamat'];
- $gd = $_POST['GD'];
- $ibu = $_POST['ibu'];
- $foto = $_FILES['foto'];
- if(!empty($foto) AND $foto['error'] == 0){
- $path = './Media/image/';
- $upload = move_uploaded_file($foto['tmp_name'], $path . $foto['name']);
- if(!$upload){
- flash('error', "Upload File Gagal");
- header('location:index.php');
- }
- $file = $foto['name'];
- }
- $sql = "INSERT INTO siswa(NIS, nama_lengkap, gender, kelas, jurusan, Alamat, Golongan_Darah, Nama_Ibu_Kandung,file) VALUES
- ('$nis', '$nama_lengkap', '$gender', '$kelas', '$jurusan', '$alamat', '$gd', '$ibu', '$file')";
- $mysqli -> query($sql) or die ($mysqli -> error);
- header('location: index.php');
- }
- include 'view/v_tambah.php';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment