不能因为我得到这个作为我的输出 处理此错误在这里输入的代码PHP错误:试图让非对象的属性
注意:试图让非对象的财产 C:\ XAMPP \ htdocs中\ SEO \ seo.php上线161注:试图获得非对象的属性 在C:\ XAMPP \ htdocs中\ SEO \上线162
和
seo.php注意:试图让非对象的属性在C:\ XAMPP \ htdocs中\ SEO \ seo.php上 线163页局:0域管理局:0外部链接:
,这是代码
$accessID = " xxxx ";
$secretKey = " xxxxxxxx";
$domain = "$sig";
$expire_in = time() + 500;
$SignIn = $accessID."n".$expire_in;
$binarySignature = hash_hmac('sha1', $SignIn, $secretKey, true);
$urlSafeSignature = urlencode(base64_encode($binarySignature));
$data = "103079215140";
$curlURL = "http://lsapi.seomoz.com/linkscape/url-metrics/?Cols=".$data."&AccessID=".$accessID."&Expires=".$expire_in."&Signature=".$urlSafeSignature;
$Domains = array($domain);
$Domai = json_encode($Domains);
$options = array(
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => $Domai
);
$ch = curl_init($curlURL);
curl_setopt_array($ch, $options);
$response = curl_exec($ch);
curl_close($ch);
$result = json_decode($response,true);
$pageAuthority=round($result[0]->upa,0);
$domainAuthority=round($result[0]->pda,0);
$externalLinks=$result[0]->ueid;
echo "Page Authority:".$pageAuthority."<br/>";
echo "Domain Authority:".$domainAuthority."<br/>";
echo "External Links:".$externalLinks."<br/>";
可以突出这行是161? – Gerton
'$ result [0]'的值是多少? – bruceyyy
检查$ result数组,可能由于解析问题而为空... print_r($ results); – maximus