0

コードで Yahoo OAuth を使用して連絡先の詳細を取得しようとしています。OAuth は正しく機能しており、Yahoo から次の stdClass を取得しています。

stdClass Object ( 
    [profile] => stdClass Object ( 
            [guid] => AA5JFPBIASDFFESAETKHA 
            [birthYear] => 1980 
            [birthdate] => 1/31 
            [created] => 2008-10-08T13:59:36Z 
            [displayAge] => 32 
            [gender] => M 
            [image] => stdClass Object ( 
                [height] => 192 
                [imageUrl] => http://socialprofiles.zenfs.com/images/636fb037c2791a06fda15adda78b38f0_192.jpg 
                [size] => 192x192 [width] => 192 
           )
           [location] => Noida, India 
           [memberSince] => 2002-03-04T11:38:32Z 
           [nickname] => Himanshu 
           [profileUrl] => http://profile.yahoo.com/AA5JFPBIZUNNQRHEA6R73NTKHA 
           [status] => stdClass Object (
                     [lastStatusModified] => 2011-10-27T17:03:35Z 
                     [linkTo] => 
                     [message] => Using Yahoo! mail after a long time.... Full of features that Gmail cannot come anywhere close to..... ) 
                     [isConnected] => false 
                     )

これは、スクリプトの 164 行目にある変数 $profile の print_r です。プログラムでこの変数を使用しようとすると、次のようなエラーが表示されます。

Notice: Undefined property: stdClass::$profileUrl in /var/www/vhosts/xyz.com/httpdocs/PHP/yahoo-api-php-client/examples/simpleauth/simpleauth.php on line 165

私のphpスクリプトの165行目は$prfurl = $profile->profileUrl;

ここで私が間違っていることを誰かが助けてくれますか? これは Yahoo の標準コードで、私は何もしていません。

4

1 に答える 1

2

そのはず$prfurl = $profile->profile->profileUrl;

于 2012-09-24T08:22:09.550 に答える