PHP Form Handling

I need to handle an undefined number of fields. I have something like this.


url?select_meta_field=title&edit_1=title+fanSERREFDFDAKLLLTGHGH&edit_5=title+FDAKLLLTGHGH&edit_34=post+2+titleKKKK&edit_52=post5+456

How can I use $_POST like an array ?

array[edit_1]=title+fanSERREFDFDAKLLLTGHGH;

I use jQuery, jquery.post with .serialize, not $_Get;

This expression


select_meta_field=title&edit_1=title+fanSERREFDFDAKLLLTGHGH&edit_5=title+FDAKLLLTGHGH&edit_34=post+2+titleKKKK&edit_52=post5+456

represent the post parameters from firebug console, for better understanding.
The html is something like this.The number of input fields are
undefined, that means I don’t know how many input field elements will be sent.
Their are dynamically created by some variables and configurations.


<input class="text" style="width: 98&#37;" type="text" name="edit_1" value="title fanSERREFDFDAKLLLTGHGH" id="edit_1"/>
<input class="text" style="width: 98%" type="text" name="edit_5" value="title FDAKLLLTGHGH" id="edit_1"/>
[

I need, the id of the field, for example edit_1 and his corresponding value from edit_1=title+fanSERREFDFDAKLLLTGHGH, to make some database operations.

I also try to use .serializeArray from jquery library, to send data as JSON, but in the console for post parameters I see


data	[object Object]
data	[object Object]
data	[object Object]
data	[object Object]

so I can’t identify correctly the json data form, so I can parse in php.

You get parameters in the URL, which are send to the $_GET variable, but you want an array in $_POST ?

Let’s assume you meant $_GET.

When you format an url like

url?edit[1][name]=ScallioXTX&edit[1][country]=NL

The $_GET looks like


array(
  'edit' => array(
     1 => array(
       'name' => 'ScallioXTX',
       'country' => 'NL',
     )
  )
)

Does that help?

I also think you should just serialize the array.