这样的问题,在DOCTYPE之前有一个这样的API在里面登陆
<?php if (!empty($_POST['phone'])) {
send_the_order ($_POST);
}
function send_the_order ($post){
$params=array(
'flow_hash' => $post['flow_hash'],
'landing' => $post['landing'],
'referrer' => $post['referrer'],
'phone' => $post['phone'],
'name' => $post['name'],
'country' => $post['country'],
'address' => $post['address'],
'email' => $post['email'],
'lastname' => $post['lastname'],
'comment' => $post['comment'],
'layer' => $post['layer'],
'sub1' => $post['sub1'],
'sub2' => $post['sub2'],
'sub3' => $post['sub3'],
'sub4' => $post['sub4'],
'sub5' => $post['sub5'],
'link_redirect' => $post['link_redirect']
);
$url = 'http://site.com/api/new-order/';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$return= curl_exec($ch);
curl_close($ch);
$array=json_decode($return, true);
header('Location: Thanks.php');
}
?>
我是从tracker重定向到landing page,get值在landing url中标明(希望我说的没错,以免迷惑任何人,我自己才刚刚开始开发)
值是site.com/?sub1={digits1}&sub2={digits2}&sub3={digits3}&sub4={digits4}&sub5={digits5}
我需要将它们与我需要插入表单的表单一起传递,以便将来自 url 例如 sub1 的数据传输到表单我通过 js 有一个动态的表单到目前为止我不会抛出代码,尝试通过这样的动态形式之一弄清楚
<form class="order_form" action="" method="POST">
<select class="country_select wheel_input" name="country">
<option value="gr">Ελλάδα</option>
<option value="cy">Κύπρος</option>
</select>
<div style="display: none">
<input type="hidden" name="ip" value="<?=$_SERVER['REMOTE_ADDR']?/>">
<input type="hidden" name="createdAt" value="<?=date(" y-m-d="" h:i:s")?="">">
<input type="hidden" name="userAgent" value="<?=$_SERVER['HTTP_USER_AGENT']?>">
<input type="hidden" name="flow_hash" value="ZVik">
<input type="hidden" name="sub1" value="">
<input type="hidden" name="sub2" value="">
<input type="hidden" name="sub3" value="">
<input type="hidden" name="sub4" value="">
<input type="hidden" name="sub5" value="">
<input type="hidden" name="referrer" value="<?=$_SERVER['HTTP_REFERER']?>">
</div>
<label for="name" class="data_label">Εισαγάγετε ένα όνομα</label>
<input class="wheel_input" type="text" name="name" required="" id="name" placeholder="Πλήρες όνομα"><label for="phone" class="data_label">Εισαγάγετε το τηλέφωνο</label>
<input class="wheel_input" type="text" id="phone" name="phone" required="" placeholder="Τηλέφωνο">
<input type="hidden" name="landing" value="blognevs.com/gr/ketodiet/108/">
<button class="main-link" type="submit">Αγορά με έκπτωση 50%!</button>
</form>
这是从代码视图中复制过来的,因为它是由几个js结构粘合在一起的,原来我需要将代码从url转移到表单的Sub1中
升级版:
formApi: {
isNeeded: 1,
landingValue: '',
countryName: 'Ελλάδα',
flowHash: 'ZVik',
priceMain: 29,
currencyMain: 'EUR',
sub1: ''
},
1 个回答