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
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"

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.