deletechannel.php 507 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. header("Content-type:text/html;charset=UTF-8");
  3. include_once("../../untils/conn.php");
  4. if (empty($_GET['channel_id'])) {
  5. exit('<h1>连接数据库失败</h1>');
  6. }
  7. $channel_id = $_GET['channel_id'];
  8. $query = mysqli_query($con, "delete from channel where channel_id = {$channel_id}");
  9. if (!$query) {
  10. echo ("<script>alert('删除失败');history.back();</script>");
  11. } else {
  12. echo "<script>alert('删除渠道成功');window.location.replace(document.referrer)</script> ";
  13. }
  14. ?>