English 中文(简体)
更改员额表数据功能,以备
原标题:Change post form data function into curl
  • 时间:2010-04-22 09:59:14
  •  标签:
  • curl

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);

是否认为我的方向是正确的?

最佳回答

这可能是行之有效的,但如果你想要使用吉大港山区基本规则,你还需要提供全权证书(姓名+密码)。

问题回答

暂无回答




相关问题
curl + sessions

I m making POST requests with CURL, and I would like to output cookies made during that request... Is that possible? :)

Curl setting Content-Type incorrectly

I am running a curl operation on the command line and am having trouble forcing the header to set as XML. I use the -H option to force the Content-Type to be xml, however, once I run the command I can ...

Create new etherpad using PHP and CURL

I m trying to write a simple PHP script which automatically sets up new etherpads (see http://etherpad.com/). They don t have an API (yet) for creating new pads so I m trying to figure if I can do ...

Finding out where curl was redirected

I m using curl to make php send an http request to some website somewhere and have set CURLOPT_FOLLOWLOCATION to 1 so that it follows redirects. How then, can I find out where it was eventually ...

热门标签