Reply to Re: Category checkboxes problem

Your name:

Reply:


Posted by Ken Robinson on 03/24/06 20:35

> 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

A different way to do this is

<INPUT TYPE="checkbox" NAME="cb[123]" VALUE="on">Category Description
<INPUT TYPE="checkbox" NAME="cb[137]" VALUE="on">Category Description

Then in you PHP, you can do
<?php
if (isset($_POST['cb']))
foreach $_POST['cb'] as $key=>$dmy)
echo 'You chose catagory ' . $key . '<br>';
?>

This works because only those checkboxes that are actually checked are
sent to your script.

Ken

[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

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