* Thus wrote Tom Rogers ([EMAIL PROTECTED]):
> Hi,
>
> Monday, July 28, 2003, 4:29:46 PM, you wrote:
> >>Try this:
> >> >>exec('ipconfig',$catch);
> >>foreach($catch as $line){
> >>if(eregi('IP Address',$line)){
> >>list($t,$ip) = split(':',$line);
> >>echo
<[EMAIL PROTECTED]>
Mark:
> For Win9x, use winipcfg instead of ipconfig.
winipcfg is a windows-based utility, which can't work with PHP.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
For Win9x, use winipcfg instead of ipconfig.
--- Chris Lee <[EMAIL PROTECTED]> wrote:
> >Try this:
> > >exec('ipconfig',$catch);
> >foreach($catch as $line){
> >if(eregi('IP Address',$line)){
> >list($t,$ip) = split(':',$line);
> >echo 'IP is '.$ip."\n";
> >
>Try this:
>exec('ipconfig',$catch);
>foreach($catch as $line){
>if(eregi('IP Address',$line)){
>list($t,$ip) = split(':',$line);
>echo 'IP is '.$ip."\n";
>}
>}
>?>
Thanks Tom, but I think it only work for Win NT, how about Win 9x?
--
PHP General
Hi,
Monday, July 28, 2003, 12:21:06 PM, you wrote:
CL> How can I get the local Computer IP Address when running PHP program in
CL> Windows command line (i.e. php getmyip.php)
CL> ** Since the PHP did not are run on Webserver, so _SERVER["SERVER_ADDR"]
CL> won't work.
CL> Many thanks in advance
5 matches
Mail list logo