RE: Re: order of elements in $_POST super global

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

 



On 08 June 2006 16:20, Ben Liu wrote:

> I probably should add some more details to my question:
> 
> The names of the form checkboxes could be changed from ie:
> bool_careers, bool_speaking, bool_internship, etc. to a single array
> bool_questions[], for instance. The problem with that is that I am
> using the form checkbox names later to process related data.
> Specifically, I am building a user-input based query. So if the form
> checkbox names are the same as the names of the variables in the
> database, it makes for easy creating of the query, since the names
> become associative keys in the $_POST array. I iterate through the
> $_POST array, checking each for true/false state.

I know you've found another (perfectly good) solution already, but I just wanted to point out that you could have used the above scenario with the names as the array indexes, like:

   <input type="checkbox" name="bool_questions[first_name]" value="yes">

The above input shows up in $_POST['bool_questions']['first_name'], so you could iterate over $_POST['bool_questions'] to get the result you want.


To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

-- 
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