Advertisement
dhiforester

hapus_akses.php

Mar 31st, 2021
531
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.79 KB | None | 0 0
  1. <?phP
  2.     //koneksi database
  3.     include "../../Config/Connection.php";
  4.     //validasi id_akses dengan metode GET
  5.     if(empty($_GET["id_akses"])){
  6.         header ("location:../../index.php?page=akses&notifikasi=id_akses_kosong");
  7.     }else{
  8.         //Buat variabel id_akses
  9.         $id_akses=$_GET['id_akses'];
  10.         //Proses Hapus dari database berdasarkan id_akses
  11.         $HapusDataAkses= mysqli_query($conn, "DELETE FROM akses WHERE id_akses='$id_akses'") or die(mysqli_error($conn));
  12.         //Apabila berhasil
  13.         if($HapusDataAkses){
  14.             header ("location:../../index.php?page=akses&notifikasi=hapus_akses_berhasil");
  15.         }else{
  16.             //Apabila gagal
  17.             header ("location:../../index.php?page=akses&notifikasi=hapus_akses_gagal");
  18.         }
  19.     }
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement