Reply to Problems with form processing: array_key_exists() and while (list($k, $v) = each($arr))

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация