php error : Trying to get property of non-object -
not able process error getting output enter code here
notice: trying property of non-object in c:\xampp\htdocs\seo\seo.php on line 161 notice: trying property of non-object in c:\xampp\htdocs\seo\seo.php on line 162
and
notice:trying property of non-object in c:\xampp\htdocs\seo\seo.php on line 163 page authority:0 domain authority:0 external links:
and code
$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/>";
you using:
$result = json_decode($response,true); ^^^^ here according manual:
when true, returned objects converted associative arrays.
so result array , there no objects.
so need:
$result[0]['upa'] // etc.
Comments
Post a Comment