Simple IP/Country

Started on the old forum in May 2012 · view the original in the archive · old links redirect here

1 reply · 593 views · started 14 years ago · 1 min read

2 participants
wap-ruler Developer · 143 posts #1

There is a simple way to get ur visitors country info frm his/her ip... Just use the code

<?php
    $IP = $_SERVER['REMOTE_ADDR'];
    $country = file_get_contents('http://api.hostip.info/country.php?ip='.$IP);
    
    echo $IP.'/'.$country;

?>

ImPoSsIbLe iS nOthInG aS ImPoSsible ItSelF SaYs "I M POSSIBLE"

shushant Developer · 207 posts #2

wap-ruler wrote: There is a simple way to get ur visitors country info frm his/her ip... Just use the code

<?php
    $IP = $_SERVER['REMOTE_ADDR'];
    $country = file_get_contents('http://api.hostip.info/country.php?ip='.$IP);
    
    echo $IP.'/'.$country;

?>

Its not Good Coz it gv 60% of Accurate value

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close