I use PHP and MySQL , and I want to store the IP addresses of users in the database for comparison purposes (for example, allowing only one flag per thread for an IP address). Would it be nice to do this as follows?
Extracting it in PHP:
$ipAddress = md5($_SERVER["REMOTE_ADDR"]);
And then save it in the database as VARCHAR(32).
If I had to use IP addresses more fully, this would not be the right way to do this, I think, but if only to make sure that the same IP address did not do something twice, it would be good to use md5encryption to simplify things (combining IPv4 and IPv6 into one)?
source
share