Storing IP Addresses
Posted: Thu Jun 19, 2008 7:10 pm
I recently saw this example on the web for storing IP addresses in a database:
http://arjen-lentz.livejournal.com/44290.html
The problem with that, however, is that it doesn't account for IPv6, which I think is just around the corner here with the rate of Chinese and Indian systems coming online so rapidly these days.
The reason I need to store this is because my client does fraud checks and wants to mark bad IP addresses where people goof with the forms on his site, or try to get more cash out of the system than they are allowed, etc. Every login, unfortunately, will have to go through an IP scan. We will log and block any one deemed a bad guy.
So, some questions:
1. Do you know a routine that is IPv4 and IPv6 and uses the least amount of space and processor time with the database and PHP?
2. Is it just better to store the IPv4/IPv6 in the database as is?
Remember -- I'm talking a database that may have a few hundred thousand members, and a site that may have nearly a 6,000 - 10,000 page hits a day among the whole site's set of pages.
http://arjen-lentz.livejournal.com/44290.html
The problem with that, however, is that it doesn't account for IPv6, which I think is just around the corner here with the rate of Chinese and Indian systems coming online so rapidly these days.
The reason I need to store this is because my client does fraud checks and wants to mark bad IP addresses where people goof with the forms on his site, or try to get more cash out of the system than they are allowed, etc. Every login, unfortunately, will have to go through an IP scan. We will log and block any one deemed a bad guy.
So, some questions:
1. Do you know a routine that is IPv4 and IPv6 and uses the least amount of space and processor time with the database and PHP?
2. Is it just better to store the IPv4/IPv6 in the database as is?
Remember -- I'm talking a database that may have a few hundred thousand members, and a site that may have nearly a 6,000 - 10,000 page hits a day among the whole site's set of pages.