Click to See Complete Forum and Search --> : REMOTE_ADDR ENV var


PittsburghRed
01-15-2004, 05:19 PM
When a request is made to a server via a form filled out from a user on a PC located at the users home ... Does this user have a unique IP address that is retrievable via the ENV var REMOTE_ADDR? If the user is on aol, is the IP address that of aol? I suppose what I really want to know is ... how can a perl program procesing a form, determine if a form is filled from the same private PC without having the user provide the info explicitly?

next1
01-16-2004, 10:28 AM
Originally posted by PittsburghRed
When a request is made to a server via a form filled out from a user on a PC located at the users home ... Does this user have a unique IP address that is retrievable via the ENV var REMOTE_ADDR?


yes


If the user is on aol, is the IP address that of aol?


yes. well presumably something to do with them anyway.


I suppose what I really want to know is ... how can a perl program procesing a form, determine if a form is filled from the same private PC without having the user provide the info explicitly?

there's no way to do that 100% for all time.
you could set a cookie if they have it enabled but they might delete it, you can test the ip but that can change by next visit..

but having said that, those 2 methods would be the most common ways of doing what you want.

PittsburghRed
01-16-2004, 04:31 PM
Thanks. I noticed while testing my script that my IP was not always the same. I never thought of setting a cookie. Maybe the user would not even know !..? Thanks.

PittsburghRed
01-16-2004, 04:35 PM
PS. AHA!!! Next visit!! So, if a user filled out the survey form several times WITHOUT LOGGING OFF, the IP would be the same. But would change for the next visit?

next1
01-16-2004, 08:14 PM
it wouldn't necessarily change, it would almost certainly change if they were on a dialup connection.

i deal with a similar issue as part of my work and we essentially use cookies to remember visitors in this way.

but like i said that's not perfect, however it is more accurate than using the ip because so many people are still on dialup connections, and so have a diff ip every session.

PittsburghRed
01-16-2004, 09:39 PM
Thanks. I will definitely write a cookie (it will be my first) and I'll let you know....