好的,所以我试图通过发布2个字段,成员ID和密码来从远程服务器数据库获取mysql行
if(isset($_GET['uid'])){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.mysite.com/get_user_info/index.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
$data = array(
'member_id' => $_GET['uid'],
'secret' => 'secret'
);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);
$info = curl_getinfo($ch);
curl_close($ch);
}在远程服务器/ get_user_info上
我有这个
$query = mysql_query("SELECT * FROM user_data WHERE user_id = '$_POST[member_id]'");
if($query){
$row = mysql_fetch_row($query);
}
print_r($row);所以我想使用curl从mysql获取用户信息行,但我只是获得文本
所以我怎么能得到可用的PHP数组,所以我可以像<?php echo $output['name']; ?>一样