Hello My Dear Friends, How Are You... Some buddy Give Me Country Flag Script. Thankyou
Country Flag Script!
Collapse
X
-
Put this where you need it.
Code:<? $IPaddress=$_SERVER['REMOTE_ADDR']; $two_letter_country_code=iptocountry($IPaddress); include("ip_files/countries.php"); $three_letter_country_code=$countries[$two_letter_country_code][0]; $country_name=$countries[$two_letter_country_code][1]; print "Two letters code: <b>$two_letter_country_code</b> |"; print "Three letters code: <b>$three_letter_country_code</b> | "; print "Country name: <b>$country_name</b> |"; // To display flag $file_to_check="flags/$two_letter_country_code.gif"; if (file_exists($file_to_check)){ print " <img src=$file_to_check width=30 height=15>"; }else{ print " <img src=flags/noflag.gif width=30 height=15>"; } function iptocountry($ip) { $numbers = preg_split( "/\./", $ip); include("ip_files/".$numbers[0].".php"); $code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]); foreach($ranges as $key => $value){ if($key<=$code){ if($ranges[$key][0]>=$code){$two_letter_country_code=$ranges[$key][1];break;} } } if ($two_letter_country_code==""){$two_letter_country_code="unkown";} return $two_letter_country_code; } ?>
Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
Visit: WapMasterz Coming Back Soon!
_______
SCRIPTS FOR SALE BY SUBZERO
Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
_______
Info & Tips
php.net
w3schools.com
Comment
-
Thank you so much, I am opening my own IP Script site,
Thank you very much for this, this forum have been the best so far! Many forums just deletes users with no acitivity, well I musta say I am so happy that my accounts was not deleted! I am very greatfull to be a part of this forum, and as a web developer and vBulletin coder and Designer its the cleanest and most educational forum I have seen so far!
Thanks for having me, and thank you for the great script!
Comment
-
Originally posted by subzero View PostPut this where you need it.
Code:<? $IPaddress=$_SERVER['REMOTE_ADDR']; $two_letter_country_code=iptocountry($IPaddress); include("ip_files/countries.php"); $three_letter_country_code=$countries[$two_letter_country_code][0]; $country_name=$countries[$two_letter_country_code][1]; print "Two letters code: <b>$two_letter_country_code</b> |"; print "Three letters code: <b>$three_letter_country_code</b> | "; print "Country name: <b>$country_name</b> |"; // To display flag $file_to_check="flags/$two_letter_country_code.gif"; if (file_exists($file_to_check)){ print " <img src=$file_to_check width=30 height=15>"; }else{ print " <img src=flags/noflag.gif width=30 height=15>"; } function iptocountry($ip) { $numbers = preg_split( "/\./", $ip); include("ip_files/".$numbers[0].".php"); $code=($numbers[0] * 16777216) + ($numbers[1] * 65536) + ($numbers[2] * 256) + ($numbers[3]); foreach($ranges as $key => $value){ if($key<=$code){ if($ranges[$key][0]>=$code){$two_letter_country_code=$ranges[$key][1];break;} } } if ($two_letter_country_code==""){$two_letter_country_code="unkown";} return $two_letter_country_code; } ?>
Comment
-
Use it With Gum_real_ip Function
Originally posted by santha26 View Postcan you give me the upto-date ip files, because it doesn't detect some ip's . I checked with my mobile it returns empty country code , but in pc it detected correctly.
Comment
-
Originally posted by Hammad View PostUse it with gum_real_ip function it will work correctly
my ip: 101.220.198.245
it should return " India "
but i m getting
Two letters code: unkown
Three letters code:
Country name:
I think that ip address was not in the ip_files folder
Can you tell me how to add new ip list to the ip_files folderLast edited by santha26; 10.09.12, 15:29.
Comment
Comment