- $curl=curl_init();
- curl_setopt($curl,CURLOPT_URL, "http://www.fuck.com/login");
- curl_setopt($curl,CURLOPT_HEADER,1);
- curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
- curl_setopt($curl,CURLOPT_POST,1);
- curl_setopt($curl,CURLOPT_PROXYTYPE,CURLPROXY_SOCKS5);//使用了SOCKS5代理
- curl_setopt($curl, CURLOPT_PROXY, "fuck.3322.org:1080");
- $data = array('user' => "geek", 'password' => 'fuck');
- curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
- //curl_setopt($curl, CURLOPT_HTTPPROXYTUNNEL, 1);如果是HTTP代理
- //curl_setopt($curl, CURLOPT_COOKIEJAR, 'cookie.txt');cookie你懂的
- $request = curl_exec($curl);
- //var_dump($request);
- curl_close($curl);
- //该片段来自于http://www.codesnippet.cn/detail/151120137189.html
来源: http://www.codesnippet.cn/detail/151120137189.html