function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Generate leads into Salesforce from existing web forms

I am the web developer of a Software Company, we have recently started to use Salesforce.

My understanding of standard web-to-lead is the form has to post to Saleforce website.
I already have a large amount of forms on our website that have a lot of functionality and need to post to within my website. I wanted to be able to grab the leads from these forms quickly and easily while still keeping the functionality that is already in place.

I found an App called FormVester, it seemed ideal for this but I don't think it's supported any longer.

Anyone know of any other way of achieving this?

It should not be difficult for you to add a call to WebToLead from within your server-side script. I have done this in PHP using cUrl. What script language(s) do you have in place?

Colin Goldberg

Hi Thanks for the reply,

yes I have been looking at using cURL

I understand the following code should work (I haven't tested it yet):


$cleanPOST = array();

foreach ($_POST as $key=>$value){
$cleanPOST[stripslashes($key)] = stripslashes($value);
// Create a new cURL resource $ch = curl_init(); // Set Options // Point to the Salesforce Web to Lead page curl_setopt($ch, CURLOPT_URL, "—encoding=UTF-8"); // Set the method to POST curl_setopt($ch, CURLOPT_POST, 1); // Pass POST data curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($cleanPOST)); curl_exec($ch); // Post to Salesforce curl_close($ch); // close cURL resource

 Would I still need to create the form fields in Salesforce? Would I need to do anything else?

Yes, that should work. And yes, you do need to create the form fields in Salesforce.



I posted an example earlier into this thread: