I've looked through the manual and I think I cant find and answer to.
I've got the following array set up:
$subtyp = array ("","red", "blue", "white");
echo "Color <select name=\"occ\">";
for ($counter=1; $counter<35; $counter++) {
echo"<OPTION>$subtyp[$counter]</OPTION>";};
echo "</SELECT></td>";
So I create the array, PHP assigns an index for each element. (correct me If I'm using the wrong terminology) I'm then creating a drop down menu populated with the elements of the array.(The drop down list works fine BTW)
Once a selection has been made, rather than insert the Color into the database I want to set a variable equal to the index that corresponds with the selected element. (I intend to INSERT this into a MySQL D😎
I'd like to have to do this on the same page that the dropdown list is created on if possible.
What is the simpliest way of doing this?
I've attempted the following with so success:
$inds = array_keys($indtype,$ind);
thanks,
Bryan