|
Posted by Andy Jeffries on 03/24/06 18:41
On Fri, 24 Mar 2006 08:34:51 -0800, fiziwig wrote:
> I can do
>
> <INPUT TYPE="checkbox" NAME="cb123" VALUE="on">Category Description
> <INPUT TYPE="checkbox" NAME="cb137" VALUE="on">Category Description
>
> Where "123", and "137" in the example are the category keys from the SQL
> table, but then how would the page that recieves those values know which
> possible variable names to look for?
foreach ($_POST as $key=>$value) {
if (ereg("cb([0-9]+)", $key, $matches)) {
print "You checked ID $matches[1]";
}
}
Cheers,
Andy
--
Andy Jeffries MBCS CITP ZCE | gPHPEdit Lead Developer
http://www.gphpedit.org | PHP editor for Gnome 2
http://www.andyjeffries.co.uk | Personal site and photos
Navigation:
[Reply to this message]
|