I am trying to submit an external form using PHP cURL. All form fields are working fine, except a problem I have with multiple checkboxes with the same name.
<input type="checkbox" name="same_name" value="value_1">
<input type="checkbox" name="same_name" value="value_2">
<input type="checkbox" name="same_name" value="value_3">
I have no problem with passing ONE of the checkboxes in the cURL request. In my POST string, I just do:
curl_setopt($ch, CURLOPT_POSTFIELDS, '...&same_name=value_1');
But now, I want to submit the form with multiple boxes checked. I tried the suggestion in the comments on this StackOverflow post:
curl_setopt($ch, CURLOPT_POSTFIELDS, '...&same_name[]=value_1&same_name[]=value_2');
But then I get a response which is based on no checked checkboxes at all, ergo it doesn't work.
Basically, how can I submit such an array correctly in this request? Who can point me in the right direction?