首页天道酬勤php header跳转,phpcurlpost请求

php header跳转,phpcurlpost请求

张世龙 05-06 06:40 120次浏览

//*

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;

}

前端get和post的区别,axios发送post请求带参数