告诉我如何在感谢页面上显示用户在表单中输入的数据
这种php代码
<?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 = 'СЮДА ОТПРАВЛЯЮТСЯ ДАННЫЕ';
$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');
}
?>
header('位置:谢谢.php'); (这里您还需要发送数据,但只有姓名和电话)这是他们访问的感谢页面
如果我将表单中的操作更改为thanks.php 页面,那么在这段代码的帮助下,数据一切正常
<?=$_POST['name'];?>
<?=$_POST['phone'];?>
但不要来到需要买家数据的服务器来形成方法,分别 POST
我想马上问,不要喊,我才刚开始明白,我请求你的帮助,我试图寻找答案,我找不到它,也许我在问这个问题不正确,因为我不知道如何正确提问
如果你需要澄清一切,我会抛开一切。
或将数据保存在会话中,然后将其从会话中取出。或将此数据作为参数传递给脚本(我不推荐此选项)