Get Country ShortCode from API
Is there a way to access the configured Country and State picklists (Setup > Data Management > State and Country Picklists) via the API?
[PHP] cURL problems; web-to-lead
How can I have PHP send data from a web form to salesforce.com? I am trying to ultimately have the user fill out the form, hit the submit button, validate the form then send the data to salesforce.com (if the form is valid) without refreshing the page. I am using cURL to do the PHP work.
The code below is in isolation. This should work by itself, correct?
* the 'oid' value is fake.
<?php $data = array( 'first_name'=> 'Marc', 'last_name' => 'Kass', 'email' => 'email@example.com', 'submit' => 'true', 'oid' => '11X011111111xX1' ); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.salesforce.com/servlet/servlet.WebToLead–encoding=ISO-8859-1"); curl_setopt($ch, CURLOPT_POST, 1 ); curl_setopt ($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $postResult = curl_exec($ch); curl_close($ch); ?>