Api集成PHP联系表

问题描述

我被困在这里。如果有人能帮助我,我将不胜感激

我在英国一些人的文档上有以下代码。这就是他们的API集成说明。

Api intergration instructions

我有一个带有基本联系表单的登录页面。表单使用PHP。所以我需要将这些线索提交到他们的自定义CRM中

这是我的着陆页https://bestmedicalaid.online/

这是我联系表格上的代码

<?PHP
$email_type = 'html';
$email = $_POST['email'];
$name = $_POST['name'];
$surname = $_POST['surname'];
$mobile = $_POST['mobile'];
//replace us3 with your actual datacenter
$submit_url = "https://ahbonitasqa.cagan.tech/api/public/leads/CreateLead";
$data = array(
    'email_address'=>$email,'name'=>$name,'surname'=>$surname,'mobile'=>$mobile,'email_type' => $email_type
);
$payload = json_encode($data);
 
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,$submit_url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch,CURLOPT_POST,CURLOPT_POSTFIELDS,urlencode($payload));
 
$result = curl_exec($ch);
curl_close ($ch);
$data = json_decode($result);
if ($data->error){
    echo $data->error;
} else {
    echo "Your Email has been submited."; 
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)