PHP
<?php session_start(); if (!isset($_SESSION['username'])) { header ('Location: /login.html'); exit; } require("../system/config.php"); if(isset($_GET[xoa])){ $idfbxoa = $_GET['xoa']; $idfbxoa = (int)$idfbxoa; mysqli_query($conn,"DELETE FROM `idtt` WHERE `idtt`.`id` = '".intval($_GET[xoa])."'"); echo '<meta http-equiv=refresh content="0; URL=/index.php">'; die('<script>alert("Xóa Thành Công"); </script>'); } ?> <div class="card"> <div class="card-body"> <center><h2>ID TƯƠNG TÁC CỦA BẠN</h2></center><hr/> <div class="table-responsive"> <table id="datatable" class="table table-striped table-bordered dt-responsive nowrap" style="border-collapse: collapse; border-spacing: 0; width: 100%;"> <thead> <tr> <th scope="col" width="25px">#</th> <th scope="col">ID TT</th> <th scope="col">Thời gian thêm</th> <th scope="col">Q.Lý</th> </tr> </thead> <tbody> <?php $lsmua = mysqli_query($conn,"SELECT * FROM idtt WHERE username = '$taikhoan'"); while ($ls = mysqli_fetch_assoc($lsmua)) { ?> <tr> <td scope="col" width="25px"><?php echo $ls['id'] ?></td> <td scope="col"><a href="//facebook.com/<?=$ls['idfb'];?>" target="_blank"><?php echo $ls['idfb'] ?></a></td> <td scope="col"><?php echo $ls['date'] ?></td> <td><a href="?xoa=<?php echo $ls['id'] ?>"><button class="btn-sm btn-danger">Xóa</button></a> </td> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div>