Skip to content

Instantly share code, notes, and snippets.

@IhwanID
Created August 31, 2018 20:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IhwanID/5baedd2e4f7de975210634501170be7e to your computer and use it in GitHub Desktop.
Save IhwanID/5baedd2e4f7de975210634501170be7e to your computer and use it in GitHub Desktop.
<?php
//session_start();
//if(! isset($_SESSION['loggedin']))
//exit('akses dilarang, silahkan login dulu');
include_once('config.php');
$id = $_GET['id'];
$query = mysqli_query($mysqli, 'DELETE FROM posts WHERE id ='. $id);
if($query){
header('Location: index.php');
}else{
exit('Deleting Failed : '. mysqli_error($mysqli));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment