Re: Is there an easier way of doing this?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris Grigor wrote:
morning all,

Is there an easier way of doing the following??

form1 submitting to form1.php
<input type="checkbox" name="1">
<input type="checkbox" name="2">
<input type="submit>

make this into:

<input type="checkbox" name="blah[1]" value="1">
<input type="checkbox" name="blah[2]" value="1">

then you can:

foreach($_POST['blah'] as $p => $x) {
  if (!isset($_POST['blah'][$p])) {
   echo "item $p was not selected";
  } else {
   echo "item $p was selected";
  }
}


--
Postgresql & php tutorials
http://www.designmagick.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux