-
IP Address
I am using $_SERVER['REMOTE_ADDR'] in my php file to get the user's IP address emailed to me.
I tested this from my machine 5 times last week, and all the 5 mails i got had the SAME IP address. But when i tested it today, I get a different IP address.
Is this how REMOTE_ADDR works? Is there a solution?
Thanks in advance
-
Hi,
so your IP address did not change over 5 days ...
Musicman
-
I haven't changed my IP address manually, in fact I dont know if thats even possible. But everyday i disconnect my internet connection before i go to bed..So will that change my IP address?
-
that would depend on if your running on a dynamic IP , if your on a static IP..should be fine..... (i think)
Freelance: AS2, AS3, PHP, MySQL, JavaScript
Skype: hunty93
-
Hi,
if you are on dynamic ip (common for domestic use), every time you connect, you get an available ip from some pool.
At home (in a big city) this is never the same; at the office (out in the countryside) there seems to be little change
Musicman
-
Oh god, so that means if a user checks my page on Monday and then checks again on Tuesday, I can get different IP address even if he had used same machine.
Can i not have ONE IP for ONE MACHINE always?
-
associate
You might want to use a Cookie or a Shared Object.
-
thanks admedia, but i guess cookies and shared objects are only meant for temporary storage of data in the users local. What if the user clears it up manually or using a PC-Cleaner software or something like that?
-
Bearded (M|G)od
There is no way to guarantee that any user will maintain the same IP address for any extended period of time.
The best way is a cookie. If a user changes their IP address, they'll still have the same cookie just as long as they don't use a different browser or clear cookies.
But that's about as best as you're going to get since IP addresses change. You would also have to consider the fact that anyone on the same network shares the same external IP address. A cookie would pinpoint a specific user. Other than that, the only real way to make sure a user is the same is through user accounts. When someone is logged in, you can be sure it's the same user.
-
Oh Ok
Anyways, thanks guys
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|