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
Encryption101Encryption101 

Posting to multiple locations

I have enabled the Web to lead functionality, however I want to retain the capability of posting the data to the already existing Access Table I have.

Is there a way to post to multiple locations after the Web to lead function is activated?
adamgadamg
You could either route the data to access and then the web to lead servlet (before the fact), or pull the data out of sforce into access (after the fact.) Either approach requires some programming, but not much. I'd opt for the latter.
escheelescheel

I have done this on a Linux server using php and curl. I wanted the web to lead user to be able to attach their resume. It worked great.

//Upload resume with datetime prefix to create a unique file.
// Insert record into database.
// Get todays date and time and set file name
$today = date("YmdHis");                          
$userfile_name = $_FILES['userfile']['name'];
$userfile_size = $_FILES['userfile']['size'];
$userfile_name = str_replace("'", "", $userfile_name);
$userfile_name = str_replace('"', '', $userfile_name);
$userfile_name = str_replace("\\", "", $userfile_name);

$uniquefile_name = $today . $userfile_name;
if (is_uploaded_file($_FILES['userfile']['tmp_name']))
{
copy($_FILES['userfile']['tmp_name'], "/web/xxxxxx/resume/$uniquefile_name");
 $uniquefile_name = $today . $userfile_name;
}
else
{
 $uniquefile_name = "";
}

?>

//
// Post to Salesforce.com
//

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL,"http://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8");
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1); // return into a variable
curl_setopt($ch, CURLOPT_POST, 1);
$postfields = "";
$postfields = $postfields . "oid=xxxxxxxxxxxxxxxx";
$postfields = $postfields . "&retURL=";
$postfields = $postfields . "&00N30000000dtRg=http://xxxxxxxxxx.com/resume/"    . urlencode($uniquefile_name) ;
$postfields = $postfields . "&salutation="         . urlencode($form["salutation"]) ;
$postfields = $postfields . "&first_name="         . urlencode($form["first_name"]) ;
$postfields = $postfields . "&last_name="          . urlencode($form["last_name"]) ;
$postfields = $postfields . "&company="            . urlencode($form["company"]) ;
$postfields = $postfields . "&email="              . urlencode($form["email"]) ;
$postfields = $postfields . "&phone="              . urlencode($form["phone"]) ;
$postfields = $postfields . "&mobile="             . urlencode($form["mobile"]) ;
$postfields = $postfields . "&street="             . urlencode($form["street"]) ;
$postfields = $postfields . "&city="               . urlencode($form["city"]) ;
$postfields = $postfields . "&state="              . urlencode($form["state"]) ;
$postfields = $postfields . "&zip="                . urlencode($form["zip"]) ;
$postfields = $postfields . "&lead_source="        . urlencode($form["lead_source"]) ;
$postfields = $postfields . "&description="        . urlencode($description) ;
$postfields = $postfields . "&00N30000000duH1="    . urlencode($StateOfInterest) ;

curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);

$results = curl_exec ($ch);
curl_close ($ch);
?>

 

 

Hope that helps.

Eric