Jump to content

tpih

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Everything posted by tpih

  1. Thanks a lot for your help mate
  2. https://developers.google.com/+/api/latest/people
  3. It is returning data. array( { ["kind"]=> string(11) "plus#person" ["id"]=> string(21) "101577478827733*****" ["displayName"]=> string(12) "Tyler *****" ["gender"]=> string(4) "male" ["url"]=> string(45) "https://plus.google.com/101577478827********" ["image"]=> array(1) { ["url"]=> string(92) "https://lh4.googleusercontent.com/-90ZR6GIMonM/AAAAAAAAAAI/AAAAAAAAACQ/6_nC11C3d_s/photo.jpg" } ["urls"]=> array(2) { [0]=> array(2) { ["value"]=> string(45) "https://plus.google.com/101577478********" ["type"]=> string(7) "profile" } [1]=> array(2) { ["value"]=> string(63) "https://www.googleapis.com/plus/v1/people/1015774788277*******" ["type"]=> string(4) "json" } } ["placesLived"]=> array(1) { [0]=> array(1) { ["value"]=> string(22) "**************" } } } As you can see there is NO email. Any idea on why no email would be appearing?
  4. Also thank you very much creata.physics var_dump is now working.
  5. I think I must have accidently uploaded the wrong file at one point because I am damn sure they were set before and they weren't just before I changed them.
  6. tried it in another place and got NULL.
  7. It did nothing. Should it have done something?
  8. get it to print what the string in "emails[].value" is but every way I have tried hasn't worked
  9. It is pretty much the sample one that google give you. <?php /* * Copyright 2011 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ require_once 'google-api-php-client/src/apiClient.php'; require_once 'google-api-php-client/src/contrib/apiPlusService.php'; session_start(); $client = new apiClient(); $client->setApplicationName("Google+ PHP Starter Application"); // Visit https://code.google.com/apis/console to generate your // oauth2_client_id, oauth2_client_secret, and to register your oauth2_redirect_uri. // $client->setClientId('insert_your_oauth2_client_id'); // $client->setClientSecret('insert_your_oauth2_client_secret'); // $client->setRedirectUri('insert_your_oauth2_redirect_uri'); // $client->setDeveloperKey('insert_your_developer_key'); $client->setScopes(array('https://www.googleapis.com/auth/plus.me')); $plus = new apiPlusService($client); if (isset($_REQUEST['logout'])) { unset($_SESSION['access_token']); } if (isset($_GET['code'])) { $client->authenticate(); $_SESSION['access_token'] = $client->getAccessToken(); header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']); } if (isset($_SESSION['access_token'])) { $client->setAccessToken($_SESSION['access_token']); } if ($client->getAccessToken()) { $me = $plus->people->get('me'); $optParams = array('maxResults' => 100); $activities = $plus->activities->listActivities('me', 'public', $optParams); // The access token may have been updated lazily. $_SESSION['access_token'] = $client->getAccessToken(); } else { $authUrl = $client->createAuthUrl(); } ?> <!doctype html> <html> <head><link rel='stylesheet' href='style.css' /></head> <body> <header><h1>Google+ Sample App</h1></header> <div class="box"> <?php if(isset($me) && isset($activities)): ?> <?php echo "Display Name: {$me['displayName']}\n"; echo "URL: {$me['url']}\n"; echo "Profile Image: {$me['image']['url']}\n"; endif; ?> </div> </body> </html>
  10. On googles developers web site it states "emails[].value" to get the value of a users email. I tried $me['emails']['value'] which some people told me to use but it didn't work. Any ideas on how to code it so it works?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.