I'm saving the user's IP addresses by saving the value of $_SERVER['REMOTE_ADDR']
in a MySQL database. Problem is that for both Firefox and Chrome $_SERVER['REMOTE_ADDR']
is ::1
(that means localhost in IPv6) and for IE and Opera is 127.0.0.1
(IPv4).
So, my questions are
Are IP versions browser-dependant? (I used to think it depended on the computer)
Should I create two fields in the database, one for IPv4 addresses and one for IPv6 ones?
Should I unify all IPs to IPv6? And how can I do this in PHP (if it's even possible)?