Re: [PHP] Re: order of elements in $_POST super global

2006-06-10 Thread Ben Liu
Hi Richard, I'm basically building a custom mysql table to delimited text file function for a membership site. So I've got a lot of typical demographic info fields like name, address, etc. The site owners would like to dump the membership information for their own purposes, but they

RE: [PHP] Re: order of elements in $_POST super global

2006-06-09 Thread Ford, Mike
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

Re: [PHP] Re: order of elements in $_POST super global

2006-06-09 Thread Ben Liu
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 is in the order it is in on the original form. If you want to present the fields in

[PHP] Re: order of elements in $_POST super global

2006-06-09 Thread Mindaugas L
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

[PHP] Re: order of elements in $_POST super global

2006-06-09 Thread Ben Liu
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

[PHP] RE: order of elements in $_POST super global

2006-06-09 Thread Ford, Mike
On 09 June 2006 13:55, 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,

Re: [PHP] Re: order of elements in $_POST super global

2006-06-09 Thread Richard Lynch
On Fri, June 9, 2006 7:34 am, Ben Liu wrote: The basic problem is that the way a $_POST variable gets processed is in the order it is in on the original form. This is an undocumented behaviour, almost for sure. Your script shouldn't rely on it, even if a skillion other scripts do. :-) --

Re: [PHP] Re: order of elements in $_POST super global

2006-06-09 Thread Richard Lynch
name=bool[0][careers] might do what you want... it's really quite difficult to say without a concrete example... On Thu, June 8, 2006 10:20 am, 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,

[PHP] Re: order of elements in $_POST super global

2006-06-08 Thread Barry
Ben Liu schrieb: Hello All, I'm using a form (method=POST) to collect 30 boolean values from the end user using a series of checkboxes in the form. The form is arranged in a table so that the 30 check boxes are not a long list but rather three columns (with related items columnized). The

[PHP] Re: order of elements in $_POST super global

2006-06-08 Thread Ben Liu
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

[PHP] Re: order of elements in $_POST super global

2006-06-08 Thread Ben Liu
Also, I need to re-order the elements in a custom manner, not simply alphabetical or reverse alphabetical or some logical way like that, more like how the original form is presented, by related fields. More specifically, the form is for a membership system, the system collects typical demographic

[PHP] Re: order of elements in $_POST super global

2006-06-08 Thread Jo�o C�ndido de Souza Neto
Since i remember, when a for POST is sent and a checkbox is not checked, php not receive this $_POST variable. That is, i think you don´t need to use a foreach to know if checkbox was checked or not. Am i wrong? Ben Liu [EMAIL PROTECTED] escreveu na mensagem news:[EMAIL PROTECTED] Hello

Re: [PHP] Re: order of elements in $_POST super global

2006-06-08 Thread Ben Liu
Hello João, You are right that the $_POST variable does not receive anything for unchecked boxes. I didn't realize that. But I still need the foreach loop for other reasons: So it looks like this: foreach ($_POST as $key = $data) { $query.=$key, ; } Instead of

Re: [PHP] Re: order of elements in $_POST super global

2006-06-08 Thread Ben Liu
Subject: Re: [PHP] Re: order of elements in $_POST super global Hello João, You are right that the $_POST variable does not receive anything for unchecked boxes. I didn't realize that. But I still need the foreach loop for other reasons: So it looks like this: foreach ($_POST as $key = $data