Skip to content

Instantly share code, notes, and snippets.

@dewwwald
Created November 1, 2015 20:00
Show Gist options
  • Save dewwwald/85b933d8fef31819415c to your computer and use it in GitHub Desktop.
Save dewwwald/85b933d8fef31819415c to your computer and use it in GitHub Desktop.
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;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment