Reply to Re: [PHP] Re: Capturing user's IP Address

Your name:

Reply:


Posted by Jon-Eirik Pettersen on 02/24/05 18:58

On Thu, 24 Feb 2005 09:42:21 +0000, Nick Talbott <nickt@powys.gov.uk> wrote:
> On Thursday 24 February 2005 9:38 am, N Deepak wrote:
> > Jacques wrote:
> > > Which function can I use to capture a user's IP Address when he registers
> > > on my site. I would like to store this value in a database.
> >
> > print $_SERVER['REMOTE_ADDR'];
> >
> > --Deepak
>
> ..But be careful! -If the user is going via a proxy to access your server
> that will be the IP address of the cache server, not the originating client.
>
> - Nick

I have seen many "my-ip"-scripts that read the X-Forwared-For:-header,
and if it is empty it uses the REMOTR_ADDR. The problem doing it this
way; the X-Forwarded-For-header can easly be modified and the
IP-address "faked". The solution is to save both if it is for logging,
and use REMOTE_ADDR for everything else.

[Back to original 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

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