Hi everyone, When I choose one of the value, I want this shown in the url. example: index.php?espess_segmento=450 . But display the values of "diametro" available in the table where the espess_segmento=450. After this I want can choose the values of "diametro" and appear in url something like this: index.php?espess_segmento=450&diametro=3. This the code I write:
<?php
function getCats1 ()
{
global $con;
$get_cats = "select * from categorias";
$run_cats = mysqli_query ($con, $get_cats);
while($row_cats= mysqli_fetch_array ($run_cats))
{
$cat_id = $row_cats['cat_id'];
$cat_title = $row_cats['cat_title'];
}
if(isset($_GET['cat'])){
$cat= $_GET['cat'];
global $con;
//Diamentro
$get_cat_pro = "SELECT * FROM produtos where cat='$cat' ";
$run_cat_pro = mysqli_query ($con, $get_cat_pro);
echo"Diâmetro <select name='diametro' onchange='location= this.value;'>";
while($row_cat_pro=mysqli_fetch_array($run_cat_pro)){
$pro_diametro = $row_cat_pro['diametro'] ;
$link_diametro= "index.php?diametro=$pro_diametro";
echo "<input type='radio' value='" .$link_diametro ."' >" . $pro_diametro . "</option>";
}
echo "</br>";
//Espess_segmento
$get_cat_pro2 = "SELECT * FROM produtos where cat='$cat' ";
$run_cat_pro2 = mysqli_query ($con, $get_cat_pro2);
echo"Espessura de Segmento <select name='espess_segmento' onchange='location= this.value;'>";
while($row_cat_pro2=mysqli_fetch_array($run_cat_pro2)){
$pro_espess_segmento = $row_cat_pro2['espess_segmento'] ;
$link_espess_segmento= "index.php?espess_segmento=$pro_diametro";
echo "<option value='" .$link_espess_segmento ."' >" . $pro_espess_segmento . "</option>";
}
echo "</select>";
}
}
?>
What I need do? Thanks for the attention!