0

我正在尝试做一个简单的登录表单来解析,但我找不到问题所在......这是我在这段代码之后得到的结果......

http://wink.hostech.co.il/admin/login.php?username=a%40a.com&password=74b87337454200d4d33f80c4663dc5e5&login=login

    $username = $_POST['username'];
$password = $_POST['password'];

$url = 'https://api.parse.com/1/login.php?username='.$username.'&password='.$password;

$headers = array(
 "Content-Type: application/json" ,
 "X-Parse-Application-Id: {app_id_hidden}" ,
 "X-Parse-REST-API-Key: {key_id_hidden}"
);

$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, $url);    
curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);

$data = curl_exec($handle);
curl_close($handle);

$array = json_decode($data);
echo $array;
print_r($array);
4

1 回答 1

0
$url ='https://api.parse.com/1/login';
$appId = '';  
$restKey = '';  

$headers = array(
    "Content-Type: application/json",  
    "X-Parse-Application-Id: " . $appId,
    "X-Parse-REST-API-Key: " . $restKey
);          

$username = "test";
$password = "test";

$rest = curl_init();  
curl_setopt($rest,CURLOPT_URL,$url);  
curl_setopt($rest,CURLOPT_HTTPGET,1);
curl_setopt($rest,CURLOPT_CUSTOMREQUEST,"GET");  
curl_setopt($rest, CURLOPT_ENCODING, 'username=test&password=test');
curl_setopt($rest,CURLOPT_HTTPHEADER,$headers);  
curl_setopt($rest,CURLOPT_SSL_VERIFYPEER, false);  
curl_setopt($rest,CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($rest);  
echo $response;   
curl_close($rest); 
于 2014-05-21T09:10:19.277 回答