RE: [PHP] getting ip of server

2005-08-12 Thread Jay Blanchard
[snip]
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?
[/snip]

Have a look here http://us2.php.net/reserved.variables

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



Re: [PHP] getting ip of server

2005-08-12 Thread Torgny Bjers
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

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



Re: [PHP] getting ip of server

2005-08-12 Thread John Nichel

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?


http://us2.php.net/manual/en/language.variables.predefined.php
Look under $_SERVER

Make a php document containing just this

?php

phpinfo();

?

...and access it thru your browser.  You'll find a ton of info.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] getting ip of server

2005-08-12 Thread Tom Cruickshank
Thanks for all the info guys! 

Apparantly I'm still not quite awake yet.

Tom


On 8/12/05, John Nichel [EMAIL PROTECTED] wrote:
 
 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?
 
 http://us2.php.net/manual/en/language.variables.predefined.php
 Look under $_SERVER
 
 Make a php document containing just this
 
 ?php
 
 phpinfo();
 
 ?
 
 ...and access it thru your browser. You'll find a ton of info.
 
 --
 John C. Nichel
 ÜberGeek
 KegWorks.com
 716.856.9675
 [EMAIL PROTECTED]
 
 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php