I tried:
$a=$_SERVER["REMOTE_ADDR"];
echo "<p>REMOTE_ADDR=$a<br>";
if($a="192.168.250.108") {
$a="61.64.101.101";
}
$aa=system('lynx -dump http://api.hostip.info/country.php?ip=$a',$location);
echo "<p>a=$a<br>aa=$aa<br>location=$location<br>";
$aa=system('lynx -dump
http://api.hostip.info/country.php?ip=61.64.101.101',$location);
echo "<p>a=$a<br>aa=$aa<br>location=$location<br>";
I get:
REMOTE_ADDR=192.168.250.108
XX
a=61.64.101.101
aa=XX
location=0
TW
a=61.64.101.101
aa=TW
location=0
as you can see, if I put the IP address in, I get the right answer (TW).
What am I doing wrong?
bye
Ronald
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php