【发布时间】:2011-09-22 14:53:48
【问题描述】:
我正在尝试使用 curl 执行一个简单的 GET,其中包含一个名为 redirect_uri 的参数。被调用的 php 文件为 $_GET["redirect_uri"] 打印出一个空字符串,它显示 red= 并且似乎没有发送任何内容。 获取代码
//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");
testget.php 文件
<?php
print "red-";
print $_GET["redirect_uri"];
?>
【问题讨论】:
-
CURLOPT_GETFIELDS 应该是/做什么?