___ ___ erkimt Error: Notice: Undefined index: d1 ___ ______ ___ azszpr297395
<form action="action.php" method="POST">
was the %code% % without value, use:
<div class="conainer">
<div class="card mx-auto w-100">
<div class="card-header">
<h5 style="color:#007BFF;">Molas de compressão Pesquisa</h5>
</div>
<div class="card-body">
<form action="action.php" method="POST">
Referencia:
<input type="text" placeholder=" Search" name="referencia"style="font-family:Arial, FontAwesome">
<br><br>
<div class="row">
Diametro do Aço (d):
<div class="col-md-4">
<input type="text" name="d1" size="6" placeholder="min">
<input type="text" name="d2" size="6" placeholder="max">
</div>
Comprimento total (L0):
<div class="col-md-4">
<input type="text" name="comp1" size="6" placeholder="min">
<input type="text" name="comp2" size="6" placeholder="max">
</div>
</div>
<br>
<div class="row">
Diametro Exterior (DE):
<div class="col-md-4">
<input type="text" size="6" name="de1" placeholder="min">
<input type="text" name="de2" size="6" placeholder="max">
</div>
Passo (P):
<div class="col-md-4">
<input type="text" name="passo1" size="6" placeholder="min">
<input type="text" name="passo2" size="6" placeholder="max">
</div>
<br>
</div>
<br>
<div class="row">
<div class="form-group">
<label for="exampleFormControlSelect1">Ordenar por:</label>
<select class="form-control" name="ordenar">
<option>Referencia</option>
<option>Diametro do Aço (d)</option>
<option>Comprimento total (L0)</option>
<option>Diametro Exterior (DE)</option>
<option>Passo (P)</option>
</select>
</div>
<div class="col-md-9">
<div align="right">
<img src="imagens/desenho33.png" align="right" height="250" width="350" >
</div>
</div>
</div>
<br>
<div align="right">
<button type="reset" align="right" class="btn btn-primary">Reset</button>
<button type="submit" align="right" class="btn btn-primary">Continuar</button>
</div>
</form>
</div>
</div>
</div>
<br>
<div class="jumbotron">
<div class="container-fluid">
<div class="row">
<div class="col-md-1">Referência</div>
<div class="col-md-2">Diametro do Aço (DE)</div>
<div class="col-md-2">Comprimento Total (L0)</div>
<div class="col-md-2">Diametro Exterior</div>
<div class="col-md-1">Passo</div>
<div class="col-md-1">Preço</div>
<div class="col-md-1"></div>
</div>
</div>
</div>
<div id="get_product"></div>
Using %code% all parameters passed to the file %code% of% %code% should be as %code% , for example, here is correct:
<?php
$d1=$_POST["d1"];
$d2=$_POST["d2"];
$comp1=$_POST["comp1"];
$comp2=$_POST["comp2"];
$de1=$_POST["de1"];
$de2=$_POST["de2"];
$passo1=$_POST["passo1"];
$passo2=$_POST["passo2"];
$ordenar=$_POST["ordenar"];
include ("db.php");
if(isset($_POST["getproduct"])){
$ordenar="nome";
}
else{
$ordenar=$_GET["ordenar"];
}
switch($ordenar){
case "referencia":
$ordenar_por="order by referencia";
case "diametroaco":
$ordenar_por="order by diametroaco";
case "comprimentototal":
$ordenar_por="order by comprimentototal";
case "diametroexterior":
$ordenar_por="order by diametroexterior";
case "passo":
$ordenar_por="order by passo";
}
// $molcomp_query="SELECT * FROM stock_comp";
$molcomp_query="select * from stock_comp where diametroaco BETWEEN '".$d1."' and '".$d2."' $ordenar_por";
$run_query = mysqli_query($con,$molcomp_query);
if (mysqli_num_rows($run_query) > 0){
while($row = mysqli_fetch_array($run_query)){
$id_mol_comp=$row['id_mol_comp'];
$referencia=$row['referencia'];
$diametroaco=$row['diametroaco'];
$comprimentototal=$row['comprimentototal'];
$diametroexterior=$row['diametroexterior'];
$passo=$row['passo'];
$preco=$row['preco'];
echo"
<div class='card mx-auto w-100'>
<div class='card-body'>
<div class='row'>
<div class='col-md-1'>$referencia</div>
<div class='col-md-2'>$diametroaco</div>
<div class='col-md-2'>$comprimentototal</div>
<div class='col-md-2'>$diametroexterior</div>
<div class='col-md-1'>$passo</div>
<div class='col-md-1'>$preco</div>
<div class='col-md-1'><i style='font-size:30px' class='fa'></i> <i style='font-size:30px' class='fa'></i> </div>
</div>
</div>
</div>
<br>
";
}
}
?>
But here, with this %code% %:
<div class="conainer">
<div class="card mx-auto w-100">
<div class="card-header">
<h5 style="color:#007BFF;">Molas de compressão Pesquisa</h5>
</div>
<div class="card-body">
<form action="action.php" method="POST">
Referencia:
<input type="text" placeholder=" Search" name="referencia"style="font-family:Arial, FontAwesome">
<br><br>
<div class="row">
Diametro do Aço (d):
<div class="col-md-4">
<input type="text" name="d1" size="6" placeholder="min">
<input type="text" name="d2" size="6" placeholder="max">
</div>
Comprimento total (L0):
<div class="col-md-4">
<input type="text" name="comp1" size="6" placeholder="min">
<input type="text" name="comp2" size="6" placeholder="max">
</div>
</div>
<br>
<div class="row">
Diametro Exterior (DE):
<div class="col-md-4">
<input type="text" size="6" name="de1" placeholder="min">
<input type="text" name="de2" size="6" placeholder="max">
</div>
Passo (P):
<div class="col-md-4">
<input type="text" name="passo1" size="6" placeholder="min">
<input type="text" name="passo2" size="6" placeholder="max">
</div>
<br>
</div>
<br>
<div class="row">
<div class="form-group">
<label for="exampleFormControlSelect1">Ordenar por:</label>
<select class="form-control" name="ordenar">
<option>Referencia</option>
<option>Diametro do Aço (d)</option>
<option>Comprimento total (L0)</option>
<option>Diametro Exterior (DE)</option>
<option>Passo (P)</option>
</select>
</div>
<div class="col-md-9">
<div align="right">
<img src="imagens/desenho33.png" align="right" height="250" width="350" >
</div>
</div>
</div>
<br>
<div align="right">
<button type="reset" align="right" class="btn btn-primary">Reset</button>
<button type="submit" align="right" class="btn btn-primary">Continuar</button>
</div>
</form>
</div>
</div>
</div>
<br>
<div class="jumbotron">
<div class="container-fluid">
<div class="row">
<div class="col-md-1">Referência</div>
<div class="col-md-2">Diametro do Aço (DE)</div>
<div class="col-md-2">Comprimento Total (L0)</div>
<div class="col-md-2">Diametro Exterior</div>
<div class="col-md-1">Passo</div>
<div class="col-md-1">Preço</div>
<div class="col-md-1"></div>
</div>
</div>
</div>
<div id="get_product"></div>
But as the %code% has been defined previously, simply do %code% %:
<?php
$d1=$_POST["d1"];
$d2=$_POST["d2"];
$comp1=$_POST["comp1"];
$comp2=$_POST["comp2"];
$de1=$_POST["de1"];
$de2=$_POST["de2"];
$passo1=$_POST["passo1"];
$passo2=$_POST["passo2"];
$ordenar=$_POST["ordenar"];
include ("db.php");
if(isset($_POST["getproduct"])){
$ordenar="nome";
}
else{
$ordenar=$_GET["ordenar"];
}
switch($ordenar){
case "referencia":
$ordenar_por="order by referencia";
case "diametroaco":
$ordenar_por="order by diametroaco";
case "comprimentototal":
$ordenar_por="order by comprimentototal";
case "diametroexterior":
$ordenar_por="order by diametroexterior";
case "passo":
$ordenar_por="order by passo";
}
// $molcomp_query="SELECT * FROM stock_comp";
$molcomp_query="select * from stock_comp where diametroaco BETWEEN '".$d1."' and '".$d2."' $ordenar_por";
$run_query = mysqli_query($con,$molcomp_query);
if (mysqli_num_rows($run_query) > 0){
while($row = mysqli_fetch_array($run_query)){
$id_mol_comp=$row['id_mol_comp'];
$referencia=$row['referencia'];
$diametroaco=$row['diametroaco'];
$comprimentototal=$row['comprimentototal'];
$diametroexterior=$row['diametroexterior'];
$passo=$row['passo'];
$preco=$row['preco'];
echo"
<div class='card mx-auto w-100'>
<div class='card-body'>
<div class='row'>
<div class='col-md-1'>$referencia</div>
<div class='col-md-2'>$diametroaco</div>
<div class='col-md-2'>$comprimentototal</div>
<div class='col-md-2'>$diametroexterior</div>
<div class='col-md-1'>$passo</div>
<div class='col-md-1'>$preco</div>
<div class='col-md-1'><i style='font-size:30px' class='fa'></i> <i style='font-size:30px' class='fa'></i> </div>
</div>
</div>
</div>
<br>
";
}
}
?>
If by %code% %: