I have an multiple category on my page to filter search.
http://localhost/shop/category/produkunggulan/CT0002
Example I have this category:
Brand
$qBrandList = mysqli_query($con, "SELECT P.productid, P.brandid_fk, B.Brandid, B.brand_name FROM tb_product P, tb_brand B WHERE P.brandid_fk = B.brandid AND P.categoryid_fk LIKE '%" . $getCategoryID . "%' GROUP BY B.brandid ORDER BY B.brand_name ASC");
while($dBrandList = mysqli_fetch_array($qBrandList))
{
?>
<div><label><input name="chkBrand[]" class="chkBrand" type="checkbox" value="<?php echo $dBrandList['brandid_fk']; ?>"/> <?php echo $dBrandList['brand_name']; ?></label></div>
<?php
}
Discount
<label><input type="checkbox" name="discount" value="Y"/> Diskon</label>
Now I want when user click the checkbox, it will be directly redirect to the url including the key of category (every click checkbox) and remove the value if uncheck.
Example I click EMORI then FOSSIL, so the URL should be:
http://localhost/shop/category/produkunggulan/CT0002?brand=BR0003,BR0010
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…