You need to sign in to do that
Don't have an account?

Posting form to http://www.salesforce.com/servlet/servlet.WebToLead
Hi,
I am developping a contact form and I have to make a double post (in php), one on my website to save data in the database and another one on salesforce website.
For this task I am using Curl, it nearly works but I am getting problems for multiple select.
Here is my php code :
*****
$information_requested = $_POST["information_requested"];
$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 );
$postContent .= "oid=00D300000000TGF&";
$postContent .= "00N30000000wTNa=$informationsRequested";
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postContent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
curl_close($ch);
*****
Here is my html code :
*****
<input type="checkbox" name="information_requested[]" value="Product1">
<input type="checkbox" name="information_requested[]" value="Product2">
<input type="checkbox" name="information_requested[]" value="Product3">
*****
In my form, informations requested are an array of checkbox.
But salesforces need a <select multiple="multiple"><option value="product1"></option></select>. I don't know if this is the problem, but maybe I don't *construct* the query in the right way.
Do you have an idea ?
Thanks a lot fro your help.
Thierry Bucco
I am developping a contact form and I have to make a double post (in php), one on my website to save data in the database and another one on salesforce website.
For this task I am using Curl, it nearly works but I am getting problems for multiple select.
Here is my php code :
*****
$information_requested = $_POST["information_requested"];
$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 );
$postContent .= "oid=00D300000000TGF&";
$postContent .= "00N30000000wTNa=$informationsRequested";
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postContent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
curl_close($ch);
*****
Here is my html code :
*****
<input type="checkbox" name="information_requested[]" value="Product1">
<input type="checkbox" name="information_requested[]" value="Product2">
<input type="checkbox" name="information_requested[]" value="Product3">
*****
In my form, informations requested are an array of checkbox.
But salesforces need a <select multiple="multiple"><option value="product1"></option></select>. I don't know if this is the problem, but maybe I don't *construct* the query in the right way.
Do you have an idea ?
Thanks a lot fro your help.
Thierry Bucco
Thanks a lot for your answer.
Do you have an exemple of using the Web Service API to add lead into sales force ?
Regards,
thierry
All Answers
Thanks a lot for your answer.
Do you have an exemple of using the Web Service API to add lead into sales force ?
Regards,
thierry
I downloaded the toolkit, but unfortunatly I don't have php 5 installed.
What can I do ?
Thanks
thierry
I just want to post checkbox from my form to a Salesforce multi picklist.
thierry
I have no way of knowing if any errors occured during the execution and I don't see my submission in the "Leads" area. Is there anyway to use curl to post to WebToLead? I will post the code if you guys need to look at it. Any help will be greatly appreciated.
Thanks,
Hi, Thierryb
For complex solutions as yours…I suggest using FormVester for AppExchange.
FormVester can generate leads from any existing online forms into Salesforce.
So in your case, you could use or create your form as normal (using php4 or 5 or whatever other programming language) and make it save data in your website database. Just build it without even thinking about web-to-lead integration. Now FormVester will take care of the web to lead…just past two line of code on your website page where the form is, then it will generate the lead into Salesforce. That way, your php form will generate the lead into your website DB and FormVester will generate the lead into Salesforce. Fast and easy solution!
The application is extremely flexible, so you can map any of your form fields to Salesforce fields…you can even map response of multiple choice questions.
Give it a try – <a href="http://www.salesforce.com/appexchange/detail_overview.jsp?NavCode__c=&amp;id=a0330000002YXhxAAG%22" target="_blank">FormVester for AppExchange</a>
Hope it will help!
Thierry,
Based on the date of your posting you've probably moved on from this problem but I just wanted to post my solution in case someone else out there is Googling with the same issue.
The problem is that when you submit multiple checkbox values via script (Coldfusion, PHP, .NET, etc) that they are usually concatenated into a single value.
For example, if you have:
<input name="myfield" type="checkbox" value="value1">
<input name="myfield" type="checkbox" value="value2">
<input name="myfield" type="checkbox" value="value3">
The Web-To-Lead servlet interpets this as a single value and receives:
myfield=value1,value2,value3
(You'll see this if you send a hidden field with the name debug and a value of 1)
SFDC doesn't recognize the comma as a delimiter and so you don't get what you expect. What makes it even more confusing is that the multipicklist values in your SFDC app display delimited by semi-colons!
Instead you need to send over:
myfield=value1
myfield=value2
myfield=value3
This did the trick. So whenever I encounter a multipicklist I just loop through the comma delimited values and send the values individually.
Hope that helps!