You are here: Re: [PHP] getting ip of server « PHP « IT news, forums, messages
Re: [PHP] getting ip of server

Posted by Torgny Bjers on 08/12/05 17:09

Tom Cruickshank wrote:
> Hello,
> I'm curious to know if there is a php command that can get the IP of the
> server it's running on. I could always do this...
>
> $results = exec("/sbin/ifconfig <ethernet device> | grep broadcast | awk
> '{print $2}'", $value);
>
> but I would prefer to not have to use system commands for this.
>
> Would anyone happen to know?

This is one of the few times I say RTFM :D
http://www.php.net/manual/en/language.variables.predefined.php

Look under $_SERVER and there's a whole bunch of nice stuff.

Regards,
Torgny

 

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

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