In the old way in our website, when users clicks “logout” button. It runs a post form function; which will pass parameters (logout, sn) to external sites to execute “logout” function. Like:
因此,我不想让用户跳跃到外部网站,而是将曲线用于张贴数据。 (由于我们处在不同领域,即认为Ajax请求不起作用)
在外部站点安装记录功能的相同数据。
// create cURL resource
$URL = "http://bswi.development.intra.local/";
//Initl curl
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $URL); // Load in the destination URL
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); //Normal HTTP request, not SSL
curl_setopt($ch, CURLOPT_POSTFIELDS, "logout=1");
// receive server response ...
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_exec ($ch);
echo $content;
curl_close ($ch);
是否认为我的方向是正确的?