$curl=curl_init();
curl_setopt($curl,CURLOPT_URL, "http://www.lvtao.net");
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, "ip: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);
$
curl
=
curl_init
(
)
;
curl_setopt
(
$
curl
,
CURLOPT_URL
,
"http://www.lvtao.net"
)
;
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
,
"ip:1080"
)
;
$
data
=
array
(
'user'
=&
gt
;
"geek"
,
'password'
=&
gt
;
'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
)
;