php header跳转,phpcurlpost请求
//*
publicstaticfunctionpost($URL,$postData ) {
$curl=curl_init (;
CURL_setopt($CURL,CfkdrsOPT_POST,true );
CURL_setopt($CURL,CfkdrsOPT_RETURNTRANSFER,true );
CURL_setopt($CURL,CfkdrsOPT_REFERER,' http://jinrong2.baidu.com ' );
CURL_setopt($CURL,CfkdrsOPT_USERAGENT,' Mozilla/5.0 ) windowsnt6.1; WOW64; RV :36.0 (gecko/2010 01 01 Firefox/36.0 );
CURL_setopt($CURL,CfkdrsOPT_fkdrs,$url );
CURL_setopt($CURL,CfkdrsOPT_POSTFIELDS,$postData );
$result=curl_exec($curl;
CURL_close($curl;
返回$ result;
}
//*
publicstaticfunctiongethttp{
$curl=curl_init (;
CURL_setopt($CURL,CfkdrsOPT_POST,false );
CURL_setopt($CURL,CfkdrsOPT_RETURNTRANSFER,true );
CURL_setopt($CURL,CfkdrsOPT_REFERER,' http://jinrong2.baidu.com ' );
CURL_setopt($CURL,CfkdrsOPT_USERAGENT,' Mozilla/5.0 ) windowsnt6.1; WOW64; RV :36.0 (gecko/2010 01 01 Firefox/36.0 );
CURL_setopt($CURL,CfkdrsOPT_fkdrs,$url );
$result=curl_exec($curl;
CURL_close($curl;
返回$ result;
}