my php and html coding:
$damt2 = isset($_POST['damt2']) ? $_POST['damt2'] : 200;
$dateinfo2 = json_decode(file_get_contents($_SESSION['base_path'] . 'dl.dict'), true);
arsort($dateinfo2);
$dateinfo2 = array_slice($dateinfo2, 0, $damt2);
Table
<input type="hidden" name="userId" value="<?= $_SESSION['userId']; ?>">
<select name="damt2" onchange="this.form.submit()">
<option value="50" <?= (isset($damt2) & $damt2 == 50) ? 'selected' : ''; ?>>50</option>
<option value="100" <?= (isset($damt2) & $damt2 == 100) ? 'selected' : ''; ?>>100</option>
<option value="200" <?= (isset($damt2) & $damt2 == 200) ? 'selected' : ''; ? >>200</option>
<input name="radio" type="radio" value="cow">Cow
<input name="radio" type="radio" value="chicken">Chicken
</select> <input type="submit" name="submit" value="Show List & Save">
<?php
foreach ($dateinfo2 as $key => $time){
$uInfo = $_SESSION['data']->table('units')->byName($key)->data();
if ($uInfo["keyword"] != 'chicken') continue;
if ($uInfo["keyword"] != 'cow') continue;
if (isset($uInfo['type']) && !empty($uInfo['type'])) {
echo '<center><font color="olive">TypE: '.$uInfo['type'].'</font><br>';
}else{
}
}
?>
Why is everything empty?
I think where I am wrong: In the foreach loop, both values continue. Select a category using the switch.
I need a form with two options (one with a search number of 50,100,200) and a second with categories like "cow" and "chicken."
Fake source
share