Hi,
I'm trying to pass strings from a drop down list. The user selects what he'd like to use and then that term is used to produce an MySQL query.
The problem I'm having is that, if what they select has more than one word, e.g. 'Species name', then only the word 'Species' is passed ($_POST).
This is the code I'm using:
$cat = array(0=> "Species name", "Genus", "Specific epithet", "Synonyms");
echo "<td class='tab'><select name='cat' style='width:120px;'>\n";
for($i =0; $i<count($cat); $i++)
{
echo "<option value = $cat[$i]>$cat[$i]\n";
}
echo "</select></td>\n";
echo "<td class='tab'><input type='text' name='name' size='30' maxlength='30'></td></tr>\n";
echo "<tr><td class='tab'><input type='submit' value='Go!'></td></tr></table>\n";
echo "<hr>\n";
I was wondering if anyone could tell me where I'm going wrong.
Many thanks,
Graham
P.S. I know that in this case it doesn't really matter because anything with more than one name has a unique first name, but I'd like to know how to do it just in case I decide to make longer lists in the future.