Instruct ICC wrote:
Use double quotes to get the value of $a or else you get the literal string 
"$a".

$aa=system("lynx -dump http://api.hostip.info/country.php?ip=$a",$location);
or
$aa=system('lynx -dump http://api.hostip.info/country.php?ip='.$a,$location);


Thanks! 1st solution did not work for me, but the second one did.

I still have a problem with it. It prints the info to the page. Can I
suppress this somehow?

man lynx
?

I don't use lynx and I don't know what you mean by "info to the page".
I tried
lynx -dump http://www.google.com
to try to see what you mean.

Maybe something to do with the last line (but I get several lines)
Return Values

Returns the last line of the command output on success, and FALSE on failure.


I have within a web page:
<?php
$a=system('/usr/bin/lynx -dump http://api.hostip.info/country.php?ip='.$aa);
?>
<H1> .....

later I pickup the variable $a again ...

The problem for me is that the line $a=system('/usr/bin/lynx -dump http://api.hostip.info/country.php?ip='.$aa); prints (before <H1>) the result ($a). I need the variable within the program, but do not want to display it. It seems that 'system' includes an 'echo'

bye

Ronald

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to