jQuery.ajax CRM 上的重复线索

问题描述 投票:0回答:0

我正在为 Wordpress 使用 Contact Form 7,我将数据发送到 CRM:

  • JS文件

    • 地图形式数据与
var data_one = event.detail.inputs[0].value;
var data_two = event.detail.inputs[1].value;
- and send data with Ajax
 jQuery.ajax({
              method: "POST",
              url: post_url,
              data: { 
                    name: data_one,
                    email: data_two
              },
              cache: false
            }).done(function( html ) {
  • PHP文件
$data = array(
    'User' => 'AdmWbs',
    'Password' => '**********',
    'name' => $_POST['name'], 
    'email' => $_POST['email']
);
# Create a connection
$url = 'http://...'; //url or webservice
$ch = curl_init($url);
# Form data string
$postString = http_build_query($data, '', '&');
# Setting our options
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
# Get the response
$response = curl_exec($ch);
//if there is an error send email to sys admin and do a redirect to home
if (strpos($response, 'abortProcessing') !== false) {
    sendMail("2",$response,$_POST['idprovenienza'],$_POST['email'],$_POST['indirizzoip']);
    header("Location: https://www.test.com/");
    die();  
}
curl_close($ch);

问题是,如果用户随机发送表格,我们会在 CRM 上找到 1、2、... 10 个相同的潜在客户

我如何阻止每次发送表单仅发送 1 次?

谢谢

每个发送表单发送一个 1 数据

ajax wordpress forms crm
© www.soinside.com 2019 - 2024. All rights reserved.