post ur view profile code then and ill edit what u need to get it working
this code i use into my usersprofiles
$ip[0] = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id='".$who."'"));
echo "Country:".network($ip,1);
this code i use into the core
function ip()
{
if($_SERVER["REMOTE_ADDR"]){$ip=$_SERVER["REMOTE_ADDR"];}
else{$ip=$_SERVER["HTTP_X_FORWARDED_FOR"];}
if(strpos($ip,",")){
$exp_ip=explode(",",$ip);
$ip=$exp_ip[0];
}
return $ip;
}
function ipinrange($ip, $range1, $range2)
{
$ip=ip2long($ip);
$range1=ip2long($range1);
$range2=ip2long($range2);
return (($ip >= $range1) && ($ip <= $range2));
}
function network($ip,$opt)
{
$result=mysql_query("SELECT * FROM network ORDER BY subone, subtwo");
while($ranges=mysql_fetch_array($result)){
if(ipinrange($ip, $ranges[1], $ranges[2])){
if(is_file("flags/".$ranges["flag"])&&$opt==1){
$flag="<img src="flags/".$ranges["flag"]."" alt="".$ranges["flag"].""/>
";
}
return $flag.$ranges["isp"]." ".$ranges["country"];
}
}
}