I do not know if it makes sense but i am trying to echo a hidden field in select box but does not work. How can i echo
echo "<input name='testt' type='hidden' id='testt' value='".$ver["cats_fee"]."'>";
in here:
<select size="1" name="parentcat">
<option value='0'>---- Top Category ----</option>
<?
$al=mysql_query("select * from cats where cats_parentid='0' order by cats_id desc");
while($ver=mysql_fetch_array($al))
{
echo "<option value='".$ver["cats_id"]."'>".$ver["cats_name"]."</option>";
$al2=mysql_query("select * from cats where cats_parentid='".$ver["cats_id"]."' order by cats_id desc");
while($ver2=mysql_fetch_array($al2))
{
echo "<option value='".$ver2["cats_id"]."'> > ".$ver2["cats_name"]."</option>";
}
}
?>
</select>
It looks like you’re trying to send multiple pieces of data based on a user-selection. It’s easier just to send the unique id (as you are already doing) then lookup the ‘fee’, along with any other data you need’ in the script that the form sends to.
As an aside, it also looks like you are making many database calls to, effectively, get all cats back. If that’s true, it’s probably more efficient to just get them all with a single call and handle the hierarchy in your script.