top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to get user's location using PHP Google APIs Client

0 votes
505 views

I want to retrieve the user's location after user signs in my website. How can I do that?

At this moment here is the scope that i have: $client->setScopes('email');
I guess I have to change that.

And to retrieve data I have the following:
$client->verifyIdToken()->getAttributes();

Do I need another method than this?

posted Sep 14, 2014 by Navneet

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Have you tried this?
$_SERVER['HTTP_referer'] // page that the user is coming from if another web site page link
$_SERVER['SRC_ADDRESS'] // clients source ip address, but this is probably a ISP's assigned address not the local one

answer Sep 15, 2014 by Daler
Similar Questions
+2 votes
+1 vote

I want to create 3 rails apps in which every app has a Google API.
1) Gmail API
2) Google+ API 3
3) Google calendar API

Please suggest how to begin with...

...