Reply to Re: Category checkboxes problem

Your name:

Reply:


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

[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

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