system command
| From: | Ronald Wiplinger | Date: | Thu, 25 Oct 2007 01:43:14 +0000 |
| Subject: | system command | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-263627@lists.php.net to get a copy of this message | ||
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