• ips dev
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
Is there a way to access the configured Country and State picklists (Setup > Data Management > State and Country Picklists) via the API?
 

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.

 

Code:
<?php
 $data = array(
  'first_name'=> 'Marc',
  'last_name' => 'Kass',
  'email'  => 'marckass@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);
?>


Any comments?
Any suggestions?

thanks