我正在使用它向另一个网站发送一些信息并且它工作正常
function post_to_url($url, $data) {
$fields = '';
foreach($data as $key => $value) {
$fields .= $key . '=' . $value . '&';
}
rtrim($fields, '&');
$post = curl_init();
curl_setopt($post, CURLOPT_URL, $url);
curl_setopt($post, CURLOPT_POST, count($data));
curl_setopt($post, CURLOPT_POSTFIELDS, $fields);
$result = curl_exec($post);
curl_close($post);
}
$data = array(
"api_key" => "****",
"api_password" => "****",
"notify_url" => "www.mysite.com",
"order_id" => "$orderid2",
"cat_1" => "$cat_1",
"item_1" => "$item1",
"desc_1" => "$desc_1",
"qnt_1" => "$qty1",
"price_1" =>"$up1",
"cat_2" => "$cat_2",
"item_2" => "$item2",
"desc_2" => "$desc_2",
"qnt_2" => "$qty2",
"price_2" => "$up2",
);
post_to_url("http://website2.com/submitorder.php", $data);
当 website2 收到信息时,它会发回我页面上显示的 xml 响应“OK-Data Received”。我可以做些什么来阻止此消息显示在我的页面上,以便使用该站点的人看不到它?