【发布时间】:2010-10-22 21:25:15
【问题描述】:
我在这里做了一些奇怪的事情,我正在从本地数据库中查询数据并使用 cURL 将其发送到 Salesforce 表单。数据正确发布到 Salesforce。但是,选择倍数没有选择正确的值。在我的代码中查看下面的 $sd["location"]:
//init curl
$ch = curl_init();
//setup the params
$url = 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
$oid = "HIDDEN";
//setup the superdelegate array
$sd = array();
$sd["oid"] = $oid;
$sd["retURL"] = "";
$sd["first_name"] = "1144asdfsadf4";
$sd["last_name"] = "SDFSD1111";
$sd["state"] = "IL";
$sd["location"] = '"Chicago","New York","California"'; //this is the value that submits to the select multiple
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($sd));
//post to Salesforce and then close the connection
curl_exec($ch);
curl_close($ch);
选择多个已在 Salesforce 中设置,具有 30 个不同的位置。我正在尝试通过应该选择的城市(芝加哥、纽约、加利福尼亚)。您能帮我修复我的代码以使其正常工作吗?
【问题讨论】: