Thanks Alain, but my problem was how can I fix up the for each clause in
this php file. Is there something we can do to run it at all??

On Mon, Sep 19, 2011 at 6:35 PM, Alain Vongsouvanh <[email protected]>wrote:

> Hello Jason,
>
> Please have a look at this nice article written by a developer from IBM
> using the Zend framework:
>
> http://www.ibm.com/developerworks/opensource/library/x-phpgooglecontact/index.html
>
> Best,
> Alain
>
> On Sat, Sep 17, 2011 at 6:59 PM, jason <[email protected]> wrote:
>
>> Hi all,
>> I am new to this group and having a little problem with a google
>> retrieving u user's contacts email list php file.
>>
>> I found a script for that on the web which has one of the file
>> "contacts.php" written as
>>
>> <?php
>> include_once 'GmailOath.php';
>> include_once 'Config.php';
>> session_start();
>> $oauth =new GmailOath($consumer_key, $consumer_secret, $argarray,
>> $debug, $callback);
>> $getcontact_access=new GmailGetContacts();
>>
>> $request_token=$oauth->rfc3986_decode($_GET['oauth_token']);
>> $request_token_secret=$oauth-
>> >rfc3986_decode($_SESSION['oauth_token_secret']);
>> $oauth_verifier= $oauth->rfc3986_decode($_GET['oauth_verifier']);
>>
>> $contact_access = $getcontact_access->get_access_token($oauth,
>> $request_token, $request_token_secret,$oauth_verifier, false, true,
>> true);
>>
>> $access_token=$oauth->rfc3986_decode($contact_access['oauth_token']);
>> $access_token_secret=$oauth-
>> >rfc3986_decode($contact_access['oauth_token_secret']);
>> $contacts= $getcontact_access->GetContacts($oauth, $access_token,
>> $access_token_secret, false, true,$emails_count);
>>
>> foreach($contacts as $k => $a)
>> {
>>        $final = end($contacts[$k]);
>>        foreach($final as $email)
>>        {
>>                echo $email["address"] ."<br />";
>>        }
>> }
>>
>> ?>
>>
>> Include with this are config.php, index.php, GmailConnect .php and
>> GMailOath.php and all can be download from this website
>> http://www.9lessons.info/2011/06/import-gmail-contacts-google-oauth.htm
>>
>> The problem is after running the program as suggested I run into this
>> error message
>>
>> Warning: Invalid argument supplied for foreach() in /home/content/
>> 83/8330183/html/gmail/contacts.php on line 18
>>
>> Could someone please tell me how can I fix this problem. Thanks very
>> much in advance.
>>
>> Jason
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
>> To post to this group, send email to
>> [email protected]
>> To unsubscribe from this group, send email to
>> [email protected]
>> For more options, visit this group at
>> http://code.google.com/apis/contacts/community/forum.html
>>
>
>
>
> --
> Alain Vongsouvanh | Developer Programs Engineer
>
> --
> You received this message because you are subscribed to the Google
> Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://code.google.com/apis/contacts/community/forum.html
>

-- 
You received this message because you are subscribed to the Google
Groups "Google Contacts, Shared Contacts and User Profiles APIs" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/contacts/community/forum.html

Reply via email to