脚本宝典收集整理的这篇文章主要介绍了php – 尝试使用curl进行GET,发送的值允许为null,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
//Get code From login and display IT $ch = curl_init(); $url = 'http://www.besttechsolutions.biz/PRojects/faceBook/testget.PHP'; //set the url,number of POST VARs,POST data curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_GET,1); curl_setopt($ch,CURLOPT_GETFIELDS,"redirect_uri=my return url"); //execute post print "new reply 2 <br>"; $result = curl_exec($ch); print $result; // print "<br> <br>"; // print $fields_string; die("hello");
<?PHP print "red-"; print $_GET["redirect_uri"]; ?>
// create curl resource $ch = curl_init(); //return the transfer as a string curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); // Follow redirects curl_setopt($ch,CURLOPT_FOLLOWLOCATION,true); // Set maximum redirects curl_setopt($ch,CURLOPT_MAXREDIRS,5); // Allow a max of 5 seconds. curl_setopt($ch,CURLOPT_TIMEOUT,5); // set url if( count($params) > 0 ) { $query = http_build_query($params); curl_setopt($ch,"$url?$query"); } else { curl_setopt($ch,$url); } // $output contains the output string $output = curl_exec($ch); // Check for errors and such. $info = curl_getinfo($ch); $errno = curl_errno($ch); if( $output === false || $errno != 0 ) { // Do error checking } else if($info['http_code'] != 200) { // Got a non-200 error code. // Do more error checking } // close curl resource to free up system resources curl_close($ch); return $output;
以上是脚本宝典为你收集整理的php – 尝试使用curl进行GET,发送的值允许为null全部内容,希望文章能够帮你解决php – 尝试使用curl进行GET,发送的值允许为null所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。