Guest User

apa aja

a guest
Jul 28th, 2015
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.65 KB | None | 0 0
  1. <?php  
  2. if (isset($_POST['bts'])){
  3.     $nama_foto=$_FILES['foto']['name'];
  4.     // Simpan ke Database
  5.     $data = mysqli_query($con,"insert into slider values ('".$_POST['judul']."','".$_POST['keterangan']."','$nama_foto')");
  6.    
  7.     // Simpan di Folder Gambar
  8.     move_uploaded_file($_FILES['foto']['tmp_name'], "images/".$_FILES['foto']['name']);
  9.                        
  10.     if ($data) {
  11.     echo "<div class='alert alert-success' role='alert'><span class='glyphicon glyphicon-ok-circle'></span> Data Berhasil disimpan</div>";
  12.     } else {
  13.     echo "<div class='alert alert-danger' role='alert'><span class='glyphicon glyphicon-remove-circle'></span> Gagal!</div>";
  14.     }
  15.     mysqli_close($con);
  16. }
  17. ?>
Advertisement
Add Comment
Please, Sign In to add comment