You are here: How to show user country (internet connection) on a page « PHP « IT news, forums, messages
How to show user country (internet connection) on a page

Posted by Sebastiano on 10/04/91 11:11

Hi everyone,
I would like to show the country of the user provider during the navigation.
I haven't problem with provider located in europe, simply this code:

$indirizzo_cliente = $_SERVER["REMOTE_ADDR"];
$i=0;
$fp = file
("http://www.ripe.net/whois?form_type=simple&full_query_string=&searchtext=$
indirizzo_cliente");

while (list ($line_num, $line) = each ($fp)) {
if(strstr($line,"country")!=""){ // or other fields like person, address
etc etc
$almenouno = true;
$lineaok[$i]=$line;
$i = $i +1;
}
}

if($almenouno==true){
echo "Dati rilevati:<BR>";
}
for($i=0;$i<count($lineaok);$i++){
echo $lineaok[$i]."<br>";
}

THE PROBLEM cames when a want to show the country of providers located in NORTH AMERICA,
in this case I have to send the query by POST (ARIN DATABASE).
So I can't match both the results of the two interrogation and then choose the right one in the same php page.


Sebastiano

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация