Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1. <?php
  2. include "koneksi.php";
  3.  
  4. if (isset($_GET['nip'])) {
  5.     $nip = $_GET['nip'];
  6. } else {
  7.     die ("Error. No nip Selected! ");  
  8. }
  9. ?>
  10. <div id="content">
  11.     <?php
  12.     //proses delete berita
  13.     if (!empty($nip) && $nip != "") {
  14.         $query = "DELETE FROM pegawai WHERE nip='$nip'";
  15.         $sql = mysql_query ($query);
  16.         if ($sql) {
  17.             echo"<script>alert('Data Pegawai telah berhasil dihapus !',document.location.href='index.php')</script>";  
  18.         } else {
  19.             echo"<script>alert('Data pegawai gagal dihapus !',document.location.href='index.php')</script>";   
  20.         }
  21.         echo "Klik <a href='index.php'>di sini</a> untuk kembali ke halaman data pegawai";
  22.     } else {
  23.         die ("Access Denied"); 
  24.     }
  25.     ?>
  26. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement