Re: order of elements in $_POST super global

From: Date: Thu, 08 Jun 2006 15:20:11 +0000
Subject: Re: order of elements in $_POST super global
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-237627@lists.php.net to get a copy of this message
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. If the checkbox is checked, I add the associative key name to the query. Eliminating the checkbox names in favor of a numerical key only would make this more complicated. - Ben On 6/8/06, Barry <barry@flyerheaven.de> wrote:
1. Use Keys in your form like a[1],a[2] 2. order the array by usort (alphabetically or whatever u prefer) that way => 2: yes it is.


« previous php.general (#237627) next »