Nice tutorial ! Very useful information. I can now extract various data using the stored IP addresses from my database and collect extra information, like location, country, timezone. Thank you for sharing.
Great video! Liked and Subbed! Could you please make a video of how to use GeoPlugin to block certain countries from seeing certain AdSense ads? That would be awesome!
$_SERVER didn't exist in earlier versions of PHP. Instead of $_SERVER['HTTP_HOST'], you have $HTTP_HOST registerd by the register_globals functionality. But, since register globals was ON, $HTTP_HOST could just as easily be passed in the URL using page.php?HTTP_HOST=whatever. The environment variables should have overwritten the get/url values, but that was dependent upon a php.ini setting, too. So, back in the day, it was safer (imo) to get the value from getenv that way you knew exactly where it was coming from. Now, though, PHP already makes the $_SERVER variable/array present, so it's a waste of time to make a call to another function to get the same value. User's can't change most of what's in the $_SERVER variable, anyhow, so it can be trusted.
yes if you are using localhost server, it wouldn't work It only work if you use real local host.... You can also check with the : $status = $geo["geoplugin_status"]; echo $status; //404:means not found- 200 is success i hope that answers your question
Some people in this world are so lazy that, seriously, they will appreciate if you, or the system, can type in for them, data like the city, zip code, state, etc.
After watching more than 10 videos on TH-cam. This old video finally saved me 😢 thanks you.
All the people that was here 9years ago respect ✊😢
Works perfectly. I like to keep my coding simple, so thanks a million.
Adam you are the best!
after trying 15-20 codes.. finally a code run exactly
thanks Adam Khoury
Thanks Adam. Outstanding as usual.
Thank you sir, for another very interesting video!!!
And thank you for the continual feedback. I appreciate you.
Thank you, my friend. The appreciation is mutual.
A good lead, i am grateful to your contributions
Worked perfectly, Thanks
Awesome Tutorial Adam!
I must say 'Thank you, Adam'
Nice tutorial !
Very useful information.
I can now extract various data using the stored IP addresses from my database and collect extra information, like location, country, timezone.
Thank you for sharing.
I like your tuto
thank you sir Adam
Thank you adam sir.. loved it.. learnt something new today from you.
Adam, you're awesome bro. Thanks a lot!
As always a great tutorial! Thanks Adam :D
Thank you so Much brother... :)
This really saved me!
Thank you.
Very useful! Thanks for the video, greetings from Ukraine, as usual!^_^
Thank you
Hi Sir is there a newer way of doing this in laravel
Great video! Liked and Subbed! Could you please make a video of how to use GeoPlugin to block certain countries from seeing certain AdSense ads? That would be awesome!
There isn't option for "zip code" :| bad thing. Anyway, another great and useful tutorial! Thanks Adam and greetings from Raleigh!
ขอบคุณครับ thank you.
Hi Adam i am from India
I tried this , but its only showing Country not region on city .
What is the command line for getting the USER IP Address?
U r the best..!! :P
It works in local host but not the live server. Can help me with the issue? Thanks
i must admit that yu are unsual programmer aka amazing programmer.
very video!!!!!!!!!! thanks
Hi Adam, need help with Geolocation,
how do I capture geolocation data such as long-lat and store them into a database?
this code not working on live server.....its working on localhost...what may be the problem???????????
I want get user's current address, how can i go about that?
Please show us to use the db in javascript
Great...
It’s not working at localhost ,kindly help ,how should I test my script at localhost
thanx bro
It does not work for the cities of Brazil??
Hi Adam Khoury stupid question. I'v always used $_SERVER['REMOTE_ADDR'] . What is difference between that and getenv('REMOTE_ADDR')? Thanks
$_SERVER didn't exist in earlier versions of PHP. Instead of $_SERVER['HTTP_HOST'], you have $HTTP_HOST registerd by the register_globals functionality. But, since register globals was ON, $HTTP_HOST could just as easily be passed in the URL using page.php?HTTP_HOST=whatever. The environment variables should have overwritten the get/url values, but that was dependent upon a php.ini setting, too. So, back in the day, it was safer (imo) to get the value from getenv that way you knew exactly where it was coming from.
Now, though, PHP already makes the $_SERVER variable/array present, so it's a waste of time to make a call to another function to get the same value. User's can't change most of what's in the $_SERVER variable, anyhow, so it can be trusted.
Matthieu vdb Thanks for the info!
so what is it i might have done wrong? not returning my info
I thinks this example doesnt work when we are working on localhost
why geoplugin not responsed in Indonesia?
ok i copied your/his code off his site, still not working. any clues? I'm running mamp on a mac
yes if you are using localhost server, it wouldn't work
It only work if you use real local host....
You can also check with the :
$status = $geo["geoplugin_status"];
echo $status; //404:means not found- 200 is success
i hope that answers your question
what does 206 means? Since i get 206 when i echo my status
200 - Full data returned
206 - Only country data
404 - No data found for the IP at all
Ok great thanks. I'm in Ghana but when I echo geoplugin_countryName I get Russia Federation :)
Oh Ok!
That make sense now. Some countries don't have exact information due to their location geography
Good Luck
not working...
Browser view
City:
Region:
Country:
What program are you using!
adobe dreamveyaver, friend
Dream weaver **
I know!=)
That's why I use NetBeans!
Okey, thanks. :)
This is the result that i get:
City:
Region:
Country:
any help pls?
Hello, you have to upload it to an online server, it won't work until that :)
@@eritsalgado5988 you were right, thanks!
Latitude :
Longitude :
it's not working in indonesia?
AN MOROCCO
City:
Region:
Country: India
it not worked for city and region in india
+Pramod Khandalkar
Same here!
it will work but make it online.. the file should live not off line
i detect in HCM, it return Hanoi :D
I hate it when websites/apps do this. It's so invasive.
Some people in this world are so lazy that, seriously, they will appreciate if you, or the system, can type in for them, data like the city, zip code, state, etc.
3rd!
nope 6th
ok says i live in the netherlands lol USA here
thanx bro