Hi Mindaugas,I wasn't trying to imply that there was something wrong or illogical about the way the $_POST variable is processed. It is logical that it processes in the order listed in html. Perhaps I should have said, "my problem" rather than "the problem". I'll be sure to read about the bug you mention. Thanks.
- BL On Jun 9, 2006, at 8:54 AM, Mindaugas L wrote:
Hello, " The basic problem is that the way a $_POST variable gets processed is in the order it is in on the original form. " I think it's very natural behaviour. But be careful with associative arrays, I think before version 5.12.there was a bug, if you want that PHP makes an associative array of form elements. http://bugs.php.net/bug.php?id=37276 Enjoy Mindaugas On 6/9/06, Ben Liu <blzabub8@xxxxxxxxx> wrote:Hi Mike, Thanks for pointing that out. I hadn't thought of it but you are right. But I still don't think this addresses the issue of ordering. The basic problem is that the way a $_POST variable gets processed isin the order it is in on the original form. If you want to present thefields in one manner and process them in a different order, you have to either use styling tricks to change the presentation order or use some post processing to change the order of the array or use potentially a ton of "if" statements or as Joao suggests, a long "switch" statement. Anyhow, thanks for the tip. - BL On 6/9/06, Ford, Mike <M.Ford@xxxxxxxxxxxxxx> wrote:> 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 thenames 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.> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php-- Mindaugas
Attachment:
smime.p7s
Description: S/MIME cryptographic signature