Jump to content

[SOLVED] Dynamic IP Tracking?


tsilenzio

Recommended Posts

First off, I tried to search for this but failed in that attempt.

 

I want to make a site that requires a user to login. If you are a registered user u can choose to login with ether your login name, or [for more security purposes] with your email address...

 

I was going to store their IP address inside a database along with the option they chose but then I realized "What if the user has dail-up [or Dynamic IP for their means of using the internet] and their IP changes every time they go to the website?"

 

[My temp-solution]: As of right now I am only using sessions, I wasn't sure if i would need to use cookies to keep track of the user, or if there were other ways? Any ideas or help would be much much appreciated

 


 

Also, just a side question.. is the use of Sessions AND Cookies a bad combination? (Some things I cannot put inside cookies such as credit-card numbers and so on..)

Link to comment
Share on other sites

The only way i can think of doing this is if you were to get the hostname instead of the IP addrews and parse it to a certain point of the address for example..

 

cpc2-basf1-0-0-cust826.nott.cable.ntl.com

 

So i would put this in the database

 

nott.cable.ntl.com

 

 

in the databvase to match my current connection and this will generally stay the same even when IP is renewed, different ISPs parse or seperate in different ways so you will have to play with the best way of seperating.

 

If you are uk based and evero0ne that logs in is uk based then you could have a look at the most common ISP's and create a lis of them and parse based on that e.g.

 

if ntl then select the last 4 exploded values when exploding by a fullstop

 

Hope i have given you some kind of idea to work on.

 

have a look at

 

http://uk3.php.net/gethostbyaddr

 

Regards

Liam

Link to comment
Share on other sites

I had one idea, was store a tracking number in a cookie and add the settings of the cookies tracking number to the database with the option of yes use email to login, or no use user name, and set the cookie to expire every month.. or never (but of course it will eventually get deleted

 

Note: This method requires daily manual garbage collection of deletion of the tracking numbers in the database for users who's cookie has expired (This way u don't keep saving a bunch of useless information)

Link to comment
Share on other sites

Okay sorry ill explain in better terms.. I have seen this used on some sites too, just never played with it..

 

The Story:

I want to make a content system that our whole town would use (school, restaurants so on..) For some important users like the mayor, I want them to have the option to use their username OR email to login, but they have pick one or the other [using a email to login gives more security and makes it a little harder to hack into]

 

The Idea:

I was going to store their option in the database by using their IP Address to identify who they are (since I need to decide if they are logging in by username or email BEFORE they login)..

 

The Problem:

Alot of the people around here have dail-up and due to that their IPs are never the same.. Thus causing the storing of IPs to be useless as to the fact that any IPs stored wont be used ever again by the same person

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.