also, hier der code des formulars
PHP-Code:
while($row = $result_zeitung->fetch_assoc() ): ?>
<tr style=" border-bottom: #7990AA;">
<td style="font-size: 12px; font-weight: bold; width: 500px;">
<?php echo $row['Verfuegbare Titel'] ?>
<p style="margin: 0px; font-size: 11px; font-style: italic; font-weight: normal;">
<?php echo $row['Kategorie'] ?></p>
</td>
<td style="text-align: right; font-size: 12px; font-weight: bold; ">
<?php echo $row['Ausgabetag'] ?>
</td>
<td style="font-size: 12px; font-weight: bold;">
<?php echo $row['preis'] ?>€
</td>
<td>
<input type='checkbox' style="margin-bottom: 5px;" name='check[]' id='check' value='<?php echo $row['ID']; ?>' />
</td>
</tr>
<?php endwhile; ?>
natürlich innerhalb des form tags per method="post" und action=" zieldokument"
var_dump($_POST['check']; gibt dieses
array(1) {
[0]=>
string(7) "1934970"
}
zurück.
PHP-Code:
if(isset($_POST['paket'])) {
if(count($_POST['check']) < 2) {
$fehler = true;
$count = 1;
}else{
$fehler = false;
$count = 0;
}
nun sollen hier die variablen $fehler und $count erstellt werden wenn die Anzahl der Elemente des Arrays kleiner 2 ist.
er scheint allerdings diese abfrage nicht zu starten???