dewwwald
11/1/2015 - 8:00 PM

Submit post processed form to salesforce using CURL

Submit post processed form to salesforce using CURL

  public function submit_to_salesforce () {
    $post_fields = http_build_query(array_merge($this->conf_fields, $this->fields));

    $ch = curl_init();
    curl_setopt($ch,CURLOPT_URL,self::$config['url']);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch,CURLOPT_POSTFIELDS, $post_fields);
    curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);

    //execute post
    $result = curl_exec($ch);
    curl_close($ch);
    return $result;
  }
}