Posted by Spartacus on 06/19/07 13:39
Hello,
I have an HTML form I'd like to process.
<select name="items[]" multiple>
<option value="doughnuts">Hot Doughnuts</option>
<option value="coffee">Hot Brewed Coffee</option>
<option value="tea">Hot Tea</option>
<option value="cake">Sponge Cake</option>
<option value="chips">Hot Chips</option>
</select>
The problem I have it where I follow the Programming PHP book:
// Should the 's' be the name of the select tag, or the name of
// the submit button?
if (array_key_exists( 's', $_POST ))
{
$selected = "User selected these options:\n\n";
while (list($k, $v) = each($_POST['items']))
{
// Is $v "doughnuts" or "Hot Doughnuts"?
$selected .= "$v\n"
}
// ...
}
Thanks for your help.
--
Spartacus
[Back to original message]
|