Настраиваем передачу лидов в партнерку по криптооферам Foxoffers. Все параметры указанные в коде, вам выдает личный менеджер партнеской сети. В главном файле с лендингом, а за частую это index.html или index.php правим форму заказа так, что бы поля формы отправки заказа имели названия имя - name, фамилия - sname, телефон - phone, почта - email и в action пропишите send.php, то есть примерно у Вас должна получиться такая форма:
<form method="post" action="send.php">
<input type="text" name="name" value="" />
<input type="text" name="sname" value="" />
<input type="text" name="phone" value="" />
<input type="text" name="email" value="" />
</form>
<?php
$affid = '40082'; //ID афилейта
$cxdtoken = 'handelpro2_40082_385171'; //CxdToken
$brandid = 'AllianceMarket-ST'; //Brand id
$country = 'PL'; //Гео лида
$key = '3d6b9201cc3247a4bcb18fad1441be1b'; //Секретный ключ
//Генерация пароля юзера
function Password($max) {
$chars="qazxswedcvfrtgbnhyujmkiolp1234567890QAZXSWEDCVFRTGBNHYUJMKIOLP";
$size=StrLen($chars)-1;
$password=null;
while($max--)
$password.=$chars[rand(0,$size)];
return $password;
}
$params = array(
'firstName' => $_POST['name'],
'lastName' => $_POST['sname'],
'phone' => $_POST['phone'],
'email' => $_POST['email'],
'password' => Password(10),
'AffId' => $affid,
'CxdToken' => $cxdtoken,
'BrandId' => $brandid,
'CountryOfRegistration' => $country,
'ProcessID' => Password(12),
'SecretKey' => $key
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://integration.mnftx.biz/integration/v1/auth/register');
curl_setopt($ch, CURLOPT_HTTPHEADER,
array(
"accept: application/json",
"Content-Type: application/json",
)
);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
$obj = json_decode($output,true);
curl_close($ch);
if($obj['redirectUrl']) {
header('Location: '. $obj['redirectUrl']);
} else {
header('Location: success.html');
}