You are here: get IP address « PHP Language « IT news, forums, messages
get IP address

Posted by Z.K. on 09/09/07 22:37

I was wondering if some could tell me how to get the IP address of the
server PC that I am using. I can get the address of the machine that is
being connected to the server, but I would like to be able to get the
server IP address as well.

I used:
<?php
//Gets the IP address
$ip = getenv("REMOTE_ADDR") ;
Echo "Your IP is " . $ip;
?>

to get the address of the machine the is connecting to the server, but
what argument would I use with getenv() to get the server's address? I
tried LOCAL_ADDR, but that did not do anything. I guess I will need to
find me a reference book somewhere that lists all the commands.

Z.K.

 

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

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