2
I am using Yahoo’s Weather API. The point is I want the time to be displayed for the user’s location.
Considering I’m wearing the following:
$BASE_URL = "http://query.yahooapis.com/v1/public/yql";
$yql_query = 'select item from weather.forecast where woeid in (select woeid from geo.places(1) where text="Lisbon, pt")';
$yql_query_url = $BASE_URL . "?q=" . urlencode($yql_query) . "&format=json&u=c";
Everything works very well, but in this case it returns the time to Lisbon, pt (The location is set in the query).
I want to go from php to fetch the user’s location, but if it is by IP, it returns the location of the internet service, which means that it is not where the user is actually. Is there another way to control this? I’ve already been able to search for javascript, but I can’t use a javascript variable in PHP.
you need to get the ip of the place where you are , with the ip you know the geographical location.
– usersantos
https://www.mylesgray.com/software/use-geolocation-get-user-location-weather-ip-address/
– usersantos
@user2964140, the ip I am in does not. As I mentioned, the ip is from my internet provider, which is in a different location. But thanks anyway
– pc_oc
just so you can...you can have an array of locations and force...
– usersantos