使用PHP的表格中的选项选择帮助&;Html

使用PHP的表格中的选项选择帮助&;Html,php,html,drop-down-menu,forms,Php,Html,Drop Down Menu,Forms,这是我的索引编码 <?php require_once '../../FV-PluginAPI.php'; // running engine fBAcctHeader(); //get account header ?> <form method="post"> <input type="hidden" name="userId" value="<?= $_SESSION['userI

这是我的索引编码

<?php
   require_once '../../FV-PluginAPI.php';     // running engine
   fBAcctHeader();                          //get account header
?>

 <form method="post">
<input type="hidden" name="userId" value="<?= $_SESSION['userId']; ?>"><br>

 <html><head><link rel="stylesheet" type="text/css" href="css/index.css" /> 
<style type="text/css">
     html, body {background-color: #f0f0f0;border:0;font-family:Hobo Std;font-size: 10pt;margin:1px;}

    .mainTable1 {margin-top: 1px; border:1px solid:#3675C5; background-color: white;  color:#40007f     }
    .mainTable th {font-size:10pt; padding: 1px; border:1px solid #40007f; background-color: #2496ff; color:white ;}
    .mainTable td {font-size:10pt;padding:1px; border:1px solid #40007f; }
    .mainTable1 {margin-top: 1px; border:1px solid:red; background-color:#f0f0f0;  color:white     }
    .mainTable1 th {font-size:10pt; padding: 1px; border:1px solid black; background-color: #007f00; color:white ;}
    .mainTable1 td {font-size:10pt;padding:1px; border:1px solid black; }
    .mainTable1 tr{height:12px;}
    .mainTable1 td:hover {background-color:#FFFF00;}    
</style>
<br>
<form name="tpform" method="post">

 <?                               # Header selection Form 
echo '<br><table class="mainTable1"  align="center">';
$damt2 = isset($_POST['damt2']) ? $_POST['damt2'] : 200;        // Confusion is   here
$dateinfo2 = json_decode(file_get_contents($_SESSION['base_path'] . 'dl.dict'), true); //dl.dict is a file from i'm getting info in Table
arsort($dateinfo2); //arsort — Sort an array in reverse order and maintain index association
$dateinfo2 = array_slice($dateinfo2, 0, $damt2); //array_slice — Extract a slice of the array

?>
<center>
<font color="darkred" >Show Last Enhanced List:&nbsp<form method="post"   style="display:inline"> 
<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>
<option value="300" <?= (isset($damt2) & $damt2 == 300) ? 'selected' : ''; ?>>300</option>

</select>  <input type="submit" name="submit" value="Show List & Save">
</center></br>
<?
echo '<tr><th>Image</th> 
<th>Info</th>
<th>Image</th><th>Info</th></tr>';

 foreach ($dateinfo2 as $key => $time)
     {
     $uInfo = $_SESSION['data']->table('units')->byName($key)->data();//item get data by name

if ($uInfo["keyword"] != 'horse'&& $uInfo["type"] != 'tree' && $uInfo["keyword"] != 'chicken'&& $uInfo["keyword"] != 'cow' && $uInfo["type"] != 'building') continue;

/* Note:    Also i can write 
 if ($uInfo["keyword"] != 'horse' &&
    $uInfo["type"] != 'tree') continue;
 */

$iconurl = GetImageURL($uInfo['iconname']);
@$bgcolor = ($bgcolor == '#B3002D') ? '#80FF00' : '#FFFFFF';

if ($QQ / 2 == intval($QQ / 2)) echo '</tr><tr style="background-color: ' . $bgcolor . ';">';   

echo '<td align="center"><br><img onclick="document.getElementById(\'itemN\').value=document.getElementById(\'itemN\').value + \'';
    echo '|'.$uInfo['code'].'';
    echo '\'" src="' . $iconurl . '"
    title="'.$uInfo[realname].' '.$uInfo[limitedStart].'"
     width="120" ';
 echo '<br><br><a  onclick="document.getElementById(\'itemN\').value=document.getElementById(\'itemN\').value+ \'';
    echo $uInfo['code'].'|';
    echo '\'"/> 

<font color="dimgray">' . $uInfo['code'] . '</font></br>';
echo '<center><font color="orange"><b>'.$uInfo['cost'].'</font><img src="'.$img1.'" width="17px"/></b><br>';
echo    '<center><font color="green"><b>'.$uInfo['cash'].'</font><img src="'.$img.'" width="17px"/></b><br></td>';

echo '<td width=200px><center><font color="black">'.$uInfo['realname'].'</font><br>';
echo '<center><font color="black">'.$uInfo['name'].'</font><br>';

# if the req info is empty then will noting show in text/heading 

if (isset($uInfo['type']) && !empty($uInfo['type'])) {
    echo '<center><font color="olive">TypE: '.$uInfo['type'].'</font><br>';
    }else{
}
if (isset($uInfo['animalType']) && !empty($uInfo['animalType'])) {
    echo '<center><font color="black">Animal TP: '.$uInfo['animalType'].'</font><br>';
    }else{
}
if (isset($uInfo['baby']) && !empty($uInfo['baby'])) {
    echo '<center><font color="jade">Baby NM: '.$uInfo['baby'].'</font><br>';
    }else{
}
if (isset($uInfo['buyable']) && !empty($uInfo['buyable'])) {
    echo '<center><font color="jade">Can Buy</font><br>';
    }else{
}
echo '<font color="darkblue">' . date($_SESSION['dateformat'], $time).'</td>';
$QQ++;

}

echo '</div></tr></tr>';
 echo '</table>';

?>


这个问题需要更多的解释和更少的代码。