Ich bin ein sehr Anfänger in der Programmierung von PHP. Ich habe den folgenden HTML-Code und zwei PHP-Code "include". Ich bin mir nicht sicher, warum ISSET() überhaupt nicht feuert. Wenn ich die isset() {} entferne es bringt die Daten völlig in Ordnung ... aber wenn ich es mit isset() versuche, zeigt es keine Daten. Kann jemand helfen?isset() funktioniert nicht richtig mit in PHP
<form action="functions/pos-getPrice.php"class="form-horizontal"
method="post">
<div class="form-group">
<label class="col-md-4 control-label">Item</label>
\t <div class="col-md-6 selectContainer">
\t \t <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-list"></i>
</span>
\t <select name="item" id="item" class="form-control selectpicker" >
\t \t <option>Please select your item</option>
\t \t <?php include "functions/pos-getItems.php" ?>
\t </select>
\t </div>
\t </div>
<div class="form-group">
\t <label class="col-md-4 control-label">Price</label>
\t \t <div class="col-md-6 selectContainer">
\t \t \t \t <div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-list"></i>
</span>
\t \t <select name="price" class="form-control selectpicker" >
\t \t \t <option value="">Please select your price</option>
\t \t <?php include "functions/pos-getPrice.php" ?>
\t \t </select>
\t </div>
\t </div>
</form>
<?php
if(isset($_POST['item']) && $_POST['item'] == 'jacket') {
include "db-Info.php";
$res = mysqli_query($con, "select id, price, pointRequired from
tblPrice");
while($row = mysqli_fetch_array($res))
{
$price = $row['price'];
$pointRequired = $row['pointRequired'];
echo "<option value=\"".$row['id']."\">";
echo "Price: $price" ?> <?php echo "Point: $pointRequired";
echo "</option>";
}
}
?>
<?php
include "db-Info.php";
$res = mysqli_query($con, "select distinct item from tblPrice");
while($row = mysqli_fetch_array($res)){
$array = $row['item'];
echo "<option value=\"".$row['item']."\">";
echo $array;
echo "</option>";
}
?>
Es gibt keine Senden-Schaltfläche. Wie übermitteln Sie das Formular? – apokryfos