How To Find Out Carrier's Name In Javascript Or Php
I need to create a unique id for every mobile device that access my webpage. I already got the user's screen resolution, browser, OS and location, but I also want to know the carri
Solution 1:
It would be a security issue if you could get this directly. A browser runs in a sandbox and should not be able to get that data.
You could log ip addresses and lookup the ranges of every carrier. That would be a smart guess I think.
You can get them from e.g. http://whois.arin.net/ui
AT&T32.0.0.0 -32.255.255.255
166.128.0.0 -166.255.255.255
Solution 2:
you can get user carrier name from ip address.
<?php$ip = $_REQUEST['REMOTE_ADDR']; // the IP address to query$query = @unserialize(file_get_contents('http://ip-
api.com/php/'.$ip));
if($query && $query['status'] == 'success') {
echo'Hello visitor from '.$query['country'].', '.$query['city'].'!';
} else {
echo'Unable to get location';
}
?>
this is working for me i hope also working for you. :)
Post a Comment for "How To Find Out Carrier's Name In Javascript Or Php"