Welcome Guest, please login or register.
Username:
Password:

Pages: [1]
0 Members and 1 Guest are viewing this topic. Topic Tools  
Read
December 07, 2008, 09:17:16 PM
techappu
Jr. Member

**

Karma: 1
Offline Offline

Posts: 58

Look forward with past things !



are you interested to find country for your website visitor freely?
I have a optimized simple PHP code to do this.

you should copy and paste anywhere in your web page, find how is working fine.

Code:
<?php
$ip
=$_SERVER['HTTP_X_FORWARDED_FOR'];
if(empty(
$ip))
$ip=$_SERVER['REMOTE_ADDR'];
$url="http://api.wipmania.com/".$ip."?google.com";
$ccode=@file_get_contents($url);
if(!empty(
$ccode) && strlen($ccode)<3){
$cflag=" <img src=\"flags/".$ccode.".png\" />";
$str=file_get_contents("countries.txt");
$pattern="/".$ccode."\s(.+)\n/";
preg_match($pattern,$str,$match);
echo $match[1].$cflag."<br/>";
}
?>


Before that you should download flags images and countries list from the below website.
It is absolutely free of cost.
Flags = http://static.wipmania.com/static/flags.zip (extract to same directory)
Countries = http://static.wipmania.com/static/countries.txt (place in same directory)


Logged

 

Read
December 07, 2008, 10:42:07 PM
forumking
Newbie
*

Karma: 0
Offline Offline

Posts: 12



I wonder this link already on websites. But you are good for implementing with PHP code.
If you know ASP.NET coding ? post IP to Country lookup script with .NET Coding for me.

I found this is the best and simple among them. Do best again ! !
Logged
 

Read
December 08, 2008, 05:06:57 PM
techappu
Jr. Member

**

Karma: 1
Offline Offline

Posts: 58

Look forward with past things !



hi king,
thanks for your interest in script for finding visitor's location.

Now Im trying implement country finder using ASP.NET, VB.NET code.

when it is competed , surely I'll post it here ..
be watching ...  Grin
Logged

 

Read
December 08, 2008, 05:25:37 PM
Priyan
The Online Money Maker
Administrator
Newbie

*****

Karma: 1
Offline Offline

Posts: 42

Mess With The Best, Die Like The Rest



Hi, techappu first very thanks for this simple PHP code Smiley And then while looking at your reply i think its not useful to do a code for this purpose in VB.NET since its a desktop oriented Program. So please do this in ASP.NET soon as its very useful to implement in many Web Based programs !
Logged

 

Pages: [1]
Jump to:  

Theme by webtechnica.net