[PHP] LAN IP address
Hi all, I would like to find a way to get my computers LAN IP address through PHP. I tried using the gethostbyname(HOSTNAME) function, however I only got back the 127.0.0.1 address. Any help is always appreciated Cheers Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LAN IP address
Philippe Reynolds wrote: Hi all, I would like to find a way to get my computers LAN IP address through PHP. I tried using the gethostbyname(HOSTNAME) function, however I only got back the 127.0.0.1 address. Any help is always appreciated Cheers Phil Server or client IP? Server : $_SERVER['SERVER_ADDR'] Client : $_SERVER['REMOTE_ADDR'] -- 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] LAN IP address
Hi. I think you want to get the internal IP adress which computer uses? Am I right? If yes, that is not possible with PHP directly, but it is possible with Java and PHP. Erik Philippe Reynolds wrote: Hi all, I would like to find a way to get my computers LAN IP address through PHP. I tried using the gethostbyname(HOSTNAME) function, however I only got back the 127.0.0.1 address. Any help is always appreciated Cheers Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LAN IP address
Yes, I would hard code my IP address but when the computer crashs the server assigns it a different IP address, so I have to make my code a tad more dynamic... I havn't touched Java in a while, would you know the function for that? Thanks again I think you want to get the internal IP adress which computer uses? Am I right? If yes, that is not possible with PHP directly, but it is possible with Java and PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LAN IP address
Okay. There I have script for you: http://pokusy.depi.sk/internalip.zip. Just download it and see the source. You can see how it works here: http://pokusy.depi.sk/inernalip/ip.php. Hope that helps you. Erik Philippe Reynolds wrote: Yes, I would hard code my IP address but when the computer crashs the server assigns it a different IP address, so I have to make my code a tad more dynamic... I havn't touched Java in a while, would you know the function for that? Thanks again I think you want to get the internal IP adress which computer uses? Am I right? If yes, that is not possible with PHP directly, but it is possible with Java and PHP -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LAN IP address
On 2005-08-29, Philippe Reynolds [EMAIL PROTECTED] wrote: Yes, I would hard code my IP address but when the computer crashs the server assigns it a different IP address, so I have to make my code a tad more dynamic... Have you had a look at tools that you get at dynip etc? -- Met vriendelijke groeten, Tim Van Wassenhove http://timvw.madoka.be -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php