I was wondering if someone could help me out with a little problem.
In a new control panel interface I have a form posted, when I print the array, im getting weird duplicated values of the arrays with underscores tagged onto the end of $_POST.
Array ( [6] => Array ( [is_staff] => y ) [7] => Array ( [can_admin_members] => y ) [8] => Array ( [is_staff] => y [can_admin_members] => y ) [6_is_staff] => y [7_can_admin_members] => y [8_is_staff] => y [8_can_admin_members] => y )
this shouldnt be there:
[6_is_staff] => y [7_can_admin_members] => y [8_is_staff] => y [8_can_admin_members] => y )
the form is basically is as follows:
$r .= $DSP->td().
$DSP->input_checkbox($row['group_id'].'[is_staff]', 'y' ).
$DSP->td_c();
$r .= $DSP->td().
$DSP->input_checkbox($row['group_id'].'[can_admin_members]', 'y' ).$DSP->td_c();
Is this a php or EE problem? Its really a pain because I will need to remove those extra values before processing into the database.
heres another example of print_r($_POST):
[15] => Array
(
[title] => SH-01
[field_id_5] => Square
[field_id_6] => 56
[field_id_7] => 67
[field_id_8] => 6
[field_id_9] => Array
(
[0] => white_script
[1] => white_laser
)
)
[16] => Array
(
[title] => SH-02
[field_id_5] => Oval
[field_id_6] => 78
[field_id_7] => 78
[field_id_8] => 9
[field_id_9] => Array
(
[0] => white_script
)
)
[15_title] => SH-01
[15_field_id_5] => Square
[15_field_id_6] => 56
[15_field_id_7] => 67
[15_field_id_8] => 6
[15_field_id_9] => Array
(
[0] => white_script
[1] => white_laser
)
[16_title] => SH-02
[16_field_id_5] => Oval
[16_field_id_6] => 78
[16_field_id_7] => 78
[16_field_id_8] => 9
[16_field_id_9] => Array
(
[0] => white_script
)
ExpressionEngine, rather sillily we have decided, makes all POST values that are arrays into regular array values. We did this as it eased some processing early on. However, we have stopped using it altogether and are removing the code in core.input.php that does it entirely in 2.0.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.