Re: [SPAM] [PHP] determining client's external IP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



this is what gnuboard4 uses to process logins

$tmp_sql = " insert into $g4[login_table] ( lo_ip, mb_id, lo_datetime,
lo_location, lo_url ) values ( '$_SERVER[REMOTE_ADDR]',
'$member[mb_id]', '$g4[time_ymdhis]', '$lo_location',  '$lo_url' ) ";^M

i thought about proxy proxy servers upstream from user?  popular of SOHO
or office environments but not for home users?........... but........
BUT you say you are getting diff ip from watismyip.com so it can't be
the proxy.

anyway, gnuboard4 is well coded.  i can't believe SERVER[remote_addr] is
at fault.


2006-03-12 (일), 20:20 -0500, David Calkins 쓰시길:
> My web page needs to determine the client's external IP address, i.e., the
> IP address that others viewing the web page would be able to use to contact
> that user's machine (assuming they've setup the appropriate forwarding into
> their actual machine of course).  In this environment the clients want 
> their external
> IP to be correctly reported, so there's no issue of people trying to 
> spoof and
> show a wrong IP.
> 
> I'm currently using $_SERVER['REMOTE_ADDR'] as this seemed like the best
> approach as I thought it would yield the IP as seen from the web server and
> hence, hopefully, as seen by everyone else on the internet.
> 
> This works in many cases, but in a couple cases users have reported issues
> with others not being able to use the IPs the web page reports to 
> contact their
> machines.  In these cases the $_SERVER['REMOTE_ADDR'] seems to be returning
> a different IP than what www.whatismyip.com <http://www.whatismyip.com> 
> returned, for example.
> 
> Is there another reccomended way to get the client's externally visible IP
> address?  Or is $_SERVER['REMOTE_ADDR'] the right approach but might
> not always work?
> 
> Thanks!
> 

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux