Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7844683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T16:57:49+00:00 2026-06-02T16:57:49+00:00

I am using this code… but i am getting some curl error in my

  • 0

I am using this code… but i am getting some curl error in my code..

 function send_data($data) {
            $url = ""; // URL to POST FORM. (Action of Form)
            $url .= '?acx=' . urlencode('V2ViSnNvbkRldkFwbkBTaWdtYUFwbjpXZWIxMjMkSnNvbg==') . '&key=' . urlencode('QW51bWF0aGlVbmRhQFNpZ21hQXBuOlVuZHVBbnVtYXRoaQ==');
            $url .= '&impdata=' . urlencode('{"System":{"Client":"SigmaApn","ACX":"V2ViSnNvbkRldkFwbkBTaWdtYUFwbjpXZWIxMjMkSnNvbg==","KEY":"QW51bWF0aGlVbmRhQFNpZ21hQXBuOlVuZHVBbnVtYXRoaQ==","ClientIP":"74.117.104.99","Mode":"TEST"},"Module":{"Process":"BatchEnrollment","Version":"2.1.5","DataDefinition":[{"Name":"enrolment_queue","IncludeRecType":"false","Identifier":"sys_batch_no","Header":["batch_no","source","source_line","agent_code","premise_id","plan_group","request_date","enrol_type","cust_firstname","cust_lastname","phone1","cm_address1","cm_city","cm_state","cm_zip","life_support","cust_status","plan_id1","contract_ind","contract_type","calc_method","rate_type","adder1_rate","cust_bill_type","edi_bill_presenter"]}],"Data":[["Batch","BATCH","1","0","PREMISE1","R","10/28/2011","M","' . $data['personalinfo_first_name'] . '","' . $data['personalinfo_last_name'] . '","8050123481","' . $data['service_address1'] . '","' . $data['service_city'] . '","' . $data['service_state'] . '","' . $data['service_zipcode'] . '","N","P","PN001","Y","MCP2","1","4","0.02","Default","ESP"]]}}');
            $url .= '&mode=' . urlencode('TEST');
            $headersVal = array("application/x-www-form-uriencoded");
            $myFile = "/tmp/isigma.txt";
            $fh = fopen($myFile, 'w') or die("can't open file");
            $ch = curl_init();    // Initialize a CURL session.
            curl_setopt($ch, CURLOPT_URL, $url);  // Pass URL as parameter.
            curl_setopt($ch, CURLOPT_STDERR, $fh);
            curl_setopt($ch, CURLOPT_POST, 1); // use this option to Post a form  
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, '1');
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, '1');
            curl_setopt($ch, CURLOPT_CAINFO, getcwd() . "/iSIGMARootCA.crt");
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
            curl_setopt($ch, CURLOPT_SSLCERT, getcwd() . "/APN_Generic_JSON.pem");
            curl_setopt($ch, CURLOPT_SSLKEY, getcwd() . "/apnakey.pem");
            curl_setopt($ch, CURLOPT_SSLCERTTYPE, "PEM");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            $result = curl_exec($ch);  // grab URL and pass it to the variable.
            curl_close($ch);  // close curl resource, and free system resources.  
            fclose($fh);

            $res_array = json_decode($result, true);

            if (!empty($result)) {
                return $res_array;
            } else {
                echo "Curl Error" . curl_error($ch);
            }
        }

thanks for help in advance..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T16:57:52+00:00Added an answer on June 2, 2026 at 4:57 pm

    I’m using this function to post data.
    You can put an associative array as second parameter, the first is the url that you want to call.

    private function postData($url, $data) {
    
            $post_data = http_build_query($data);
            $fp = tmpfile();
            $curl = curl_init();
            curl_setopt($curl, CURLOPT_URL, $url);
            curl_setopt($curl, CURLOPT_TIMEOUT, 20);
            curl_setopt($curl, CURLOPT_FILE, $fp);
            curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);
            curl_setopt($curl, CURLOPT_VERBOSE, 1);
            curl_setopt($curl, CURLOPT_FAILONERROR, 1);
            curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
            curl_setopt($curl, CURLOPT_COOKIEJAR, '/dev/null');
    
            $status = curl_exec($curl);
            $response['http_code'] = curl_getinfo($curl, CURLINFO_HTTP_CODE);
    
            if ($status) {
                $response['error'] = curl_error($curl);
                $response['errno'] = curl_errno($curl);
            }
    
            curl_close($curl);
    
            rewind($fp);
    
            $response['data'] = '';
            while ($str = fgets($fp, 4096)) {
                $response['data'] .= $str;
            }
            fclose($fp);
    
            return $response['data'];
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using this code $.getJSON(http://mydomain.com/getcustomers?callback=?,function(data) { .... }).error(function(err){ .... }) I'm getting jQuery16103492487950357067_1336742910384 was not
I am using this code: $.getJSON(url, function(data) { console.log(data); }, json); Now, nothing gets
I'm using this code to get data using cURL $url='http://example.com/'; //URL to get content
Using this code I am trying to get the data from Templates.plist file but
Using this code: $.each(data.toptracks.track, function(index, item){ $('.lastfm').append('<figure class=clearfix><p><a href='+item.url+'>'+item.name+'</a>'+item.artist.name+'</p><div class=vinyl><img class=recordLabel src=' + item.image[3]['#text']
Using this code var html='<div class=somediv></div>'; var target=document.getElementById('contentArea'); target.appendChild(html); I'm getting Uncaught Error: NOT_FOUND_ERR:
Using This code: I am tring to fill the page with the data and
Using this code it should return a list of the assets. But it crashes,
Using this code: var pendingRequest = new Ajax.Request(myUrl, { method: 'post', postBody: soapMsg, contentType:
Using this code causes a Bus Error. Can someone point out what is wrong

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.