runnerjp Posted April 19, 2008 Share Posted April 19, 2008 would it be wise to store a list of users who have logge din and their ip address for security reasons or is it a waste of time? Link to comment https://forums.phpfreaks.com/topic/101843-storing-ip-adresses/ Share on other sites More sharing options...
haku Posted April 19, 2008 Share Posted April 19, 2008 As long as its nothing that has to be 100% reliable, there is no harm in doing it. But if you are doing it to ban a person from a site, its not going to work. If you are doing it to record who posted something on a site or uploaded a file or whatnot, its a good idea - it gives you some form of traceability in the future if you need it. Link to comment https://forums.phpfreaks.com/topic/101843-storing-ip-adresses/#findComment-521189 Share on other sites More sharing options...
runnerjp Posted April 19, 2008 Author Share Posted April 19, 2008 ok so would i gether there ip on sign up and use it form there or what>> Link to comment https://forums.phpfreaks.com/topic/101843-storing-ip-adresses/#findComment-521193 Share on other sites More sharing options...
haku Posted April 19, 2008 Share Posted April 19, 2008 Personally, anytime a new row is created in a table, I add the person's IP address. I get it right then and there, as IP addresses are dynamic. I use the following function to get them: function get_ip_address() { if($_SERVER['HTTP_X_FORWARDED_FOR'] != "") { return $_SERVER['HTTP_X_FORWARDED_FOR']; } $ip = $_SERVER['REMOTE_ADDR']; return $ip; } Link to comment https://forums.phpfreaks.com/topic/101843-storing-ip-adresses/#findComment-521200 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.