Though remote_addr cannot be directly inserted by the user as far as i know, it can be spoofed. Above is NOT secure.
Don't hesitate to use it for the guestbook of your pet's site, but don't use it for anything more complicated
(the value will always be an IP-address, because your server fills it as such, but the request (indirectly) provides the data. There is no separate way to inform your server what IP-adress gave the origional request then the request itself, therefore it is not to be trusted)
Partager