Jump to content

How to post Multiselect list using CURL


madhavvyas

Recommended Posts

Hello ,

 

I want to post multiselect list using curl here is my code

my post array

 

Array
(
    [filetype] => tab
    [cateogry] => ALL
    [manufacturer] => ALL
    [invtype] => both
    [columndata] => Array
        (
            [0] => sku
            [1] => sdesc
            [2] => qty
            [3] => price
            [4] => map
            [5] => mrp
            [6] => mfgn
            [7] => mfg
            [8] => upc
            [9] => cat
            [10] => wt
            [11] => fdesc
            [12] => acc
            [13] => pi
            [14] => wa
            [15] => ti
            [16] => imgpath
            [17] => 
            [18] => 
            [19] => 
            [20] => 
            [21] => 
        )

    [input] => SUBMIT
)

 

 

Here is the string

what I generate

 

$strQueryString = "filetype=tab&cateogry=ALL&manufacturer=ALL&invtype=both&columndata=Array&input=SUBMIT"

 

My curl code is

curl_setopt($conn, CURLOPT_URL, $strQueryString );
curl_setopt($conn, CURLOPT_POST, count($post));
curl_setopt ($conn, CURLOPT_POSTFIELDS, $strQueryString );
$page = curl_exec ($conn);

 

but it was not working

Link to comment
https://forums.phpfreaks.com/topic/106249-how-to-post-multiselect-list-using-curl/
Share on other sites

put the array in a variable,

 

$array = array(/* your array here*/);

 

then change:

$strQueryString = "filetype=tab&cateogry=ALL&manufacturer=ALL&invtype=both&columndata=Array&input=SUBMIT"

 

to:

$strQueryString = "filetype=tab&cateogry=ALL&manufacturer=ALL&invtype=both&columndata=$array&input=SUBMIT"

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.