@MOmerAlpi; yazın bekliyorum çünkü bu şekilde ajax post ile çalışmıyor. bu yöntemleri denemiştim.



@MOmerAlpi; bu işlemleri deneyip bilgi vereceğim.



@MOmerAlpi;

Bu şekilde yapamadım.



    if ($_POST['type'] == "cccccccccc") {
        
        $control = $db->prepare("SELECT * FROM xxxxxxxx WHERE item_id = ? AND buy_user_id = ? AND sell_user_id = ?");
        $control->execute(array($_POST['item_id'],$_SESSION['id'],$_POST['sell_user_id']));

        if ($control->rowCount()) {
            
            $control_check = $db->prepare("SELECT * FROM yyyyyyyyy WHERE id = ? AND user_id = ?");
            $control_check->execute(array($_POST['item_id'],$_POST['sell_user_id']));

            $row = $control_check->fetch(PDO::FETCH_ASSOC);
            
            if ($control_check->rowCount()) {
                
                $file = $row['product_file'];
                header('Content-Type: application/octet-stream');
                header('Content-Disposition: attachment; filename="dosya.zip"');
                readfile ($file);
                exit();

            }
            
        }

}

    function cccc(item_id,sell_user_id) {
        
        $.post("general.php", {type:"cccc", item_id: item_id, sell_user_id: sell_user_id},function (data) {
            
            setTimeout(function() {
            
                alert("inmesi lazım");
            
            }, 2000);
            
        });

    }