Created
October 7, 2019 07:33
-
-
Save tfkproject/841f137b4045e4a1e5acf7c42601670a to your computer and use it in GitHub Desktop.
Untuk proses simpan
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$judul = mysqli_real_escape_string($conn, $_POST['judul']); | |
$keterangan = mysqli_real_escape_string($conn, $_POST['keterangan']); | |
$file_lampiran = $_FILES['file_lampiran']['name']; | |
$result = mysqli_query($conn, " | |
INSERT INTO `pengumuman` (`id_pengumuman`, `judul`, `keterangan`, `file_lampiran`, `timestamp`, `status`) | |
VALUES | |
(NULL, '$judul', '$keterangan', '$file_lampiran', CURRENT_TIMESTAMP, 'Tidak Aktif') | |
"); | |
if($result){ | |
move_uploaded_file($_FILES['file_lampiran']['tmp_name'], "../download/".$file_lampiran); | |
header("location: list_data.php"); // menuju file yang mau di redirect, misal list_data.php | |
}else{ | |
// kembali ke halaman form tambah | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment