Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include("config.php");
- header("Access-Control-Allow-Origin: *");
- header("Access-Control-Allow-Headers: *");
- header("Access-Control-Allow-Methods: *");
- if($_SERVER['REQUEST_METHOD'] == 'GET'){
- $id = str_replace("'", "\'", $_GET['id']);
- $sql = "DELETE FROM calon_siswa
- WHERE id=$id";
- $query = mysqli_query($db, $sql);
- if ($query) {
- die(json_encode([
- "error" => 0,
- "status" => "OK"
- ]));
- } else {
- die(json_encode([
- "error" => 500,
- "status" => "Internal Server Error"
- ]));
- }
- }else{
- die("Method not allowed");
- }
Advertisement
Add Comment
Please, Sign In to add comment