카테고리 삭제 기능로그인

카테고리 삭제 기능

먼저 삭제 태그와 모든 삭제 태그 모두에 태그를 추가하세요

<?php
<a href="typesave.php?action=del&id=<?php echo $row['id']?>">删除</a>
<a href="javascript:delall()">全部删除</a><a href="typeadd.php"> 添加类别</a>


get 요청을 받고 그런 다음 typasave.php 페이지에서 처리하세요

typeave.php 페이지에 다음 코드를 추가하세요:

elseif ($_GET["action"]=="del"){
    $id=$_GET['id'];
    $sql = "delete from type where id=$id";
    if ($mysqli->query($sql)) {
        echo "<script>alert('类别删除成功')</script>";
        echo "<script>window.location='typelist.php'</script>";
    }
}elseif ($_GET["action"]=="delall"){
    $arrid=$_GET["arrid"];
    $arr=rtrim($arrid,",");
    $sql="delete from type where id in ($arr)";
    $result=$mysqli->query($sql);
    if($result){
        echo "<script>alert('类别删除成功!')</script>";
        echo "<script>window.location.href='typelist.php'</script>";
    }

효과 표시:

gif5新文件 (7).gif


다음 섹션
<?php echo "类别删除功能";
코스웨어