curl postfields issue
Posted: Wed Nov 04, 2009 3:35 pm
Hi
I have an array which I send with CURLOPT_POSTFIELDS option in curl_setopt.

Well I need to add to this array $tab the values of cid[] but in php an array can countain only a unique key, so I can't do this :
In this case I am blocked I don't know how to construct this array or send data using string instead of an array ?
Think you
I have an array which I send with CURLOPT_POSTFIELDS option in curl_setopt.

Code: Select all
$tab = array();
$tab['search'] = '';
$tab['filter_sectionid'] = '16';
$tab['catid'] = '0';
$tab['filter_authorid'] = '0';
$tab['filter_state'] = 'U';
$tab['toggle'] = '';
$tab['limit'] = '0';
$tab['limitstart'] = '0';
$tab['option'] = 'com_content';
$tab['task'] = 'remove';
$tab['boxchecked'] = '2';
$tab['redirect'] = '-1';
$tab['filter_order'] = 'section_name';
$tab['filter_order_Dir'] = '';
Code: Select all
$tab = array();
$tab['search'] = '';
$tab['filter_sectionid'] = '16';
$tab['catid'] = '0';
$tab['filter_authorid'] = '0';
$tab['filter_state'] = 'U';
$tab['toggle'] = '';
$tab['limit'] = '0';
$tab['limitstart'] = '0';
$tab['option'] = 'com_content';
$tab['task'] = 'remove';
$tab['boxchecked'] = '2';
$tab['redirect'] = '-1';
$tab['filter_order'] = 'section_name';
$tab['filter_order_Dir'] = '';
// Add cid[] values
$tab['cid[]'] = '48';
$tab['cid[]'] = '47';
$tab['cid[]'] = '46';
$tab['cid[]'] = '42';
Code: Select all
task=remove&boxchecked=2&redirect=-1filter_order=section_namefilter_order_Dir=&cid[]=48&cid[]=47&cid[]=46&cid[]=42