[PHP] IP Address Variable
I currently log ip address that reach my site. However, I want to be able to log both the ip address and remote name. Can anyone help? Thanks, Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] IP Address Variable
check this out http://www.php.net/manual/en/function.gethostbyaddr.php jim - Original Message - From: Ben Clumeck [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 14, 2001 2:48 PM Subject: [PHP] IP Address Variable I currently log ip address that reach my site. However, I want to be able to log both the ip address and remote name. Can anyone help? Thanks, Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] IP Address Variable
Jim, Thanks for your quick response. I looked over the URL and tried it but it doesn't seem to work. I tried: ?php $name = gethostbyaddr($ip); print ($ip is $name\n); ? Any advice would be appreciated. Ben -Original Message- From: Jim Lucas [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 14, 2001 2:57 PM To: Ben Clumeck; [EMAIL PROTECTED] Subject: Re: [PHP] IP Address Variable check this out http://www.php.net/manual/en/function.gethostbyaddr.php jim - Original Message - From: Ben Clumeck [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, November 14, 2001 2:48 PM Subject: [PHP] IP Address Variable I currently log ip address that reach my site. However, I want to be able to log both the ip address and remote name. Can anyone help? Thanks, Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] IP Address Variable
It may not work, if you are running Windows PHP on your localhost at home. I'll bet you are trying to log getenv('REMOTE_HOST'). Been there done that. I use http://www.indigostar.com/microweb.htm to create a localhost to develop and debug and then upload to the server. (I pay for modem time.) I remember this not working if I used it at home. Are you sure you are not looking for getenv('REMOTE_HOST') in addition to getenv('REMOTE_ADDR'} You may want this instead. Here's some of my code: ?php $machine = getenv('REMOTE_HOST'); if(!strpos($machine, collegesherbrooke.qc.ca)) { include exterior.html; }else{ echo FRAMESET cols=\200,*\ FRAME src=\index_tree.html\ name=\treeframe\ FRAME SRC=\college.html\ name=\basefrm\ /FRAMESET; } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]