how to log ip addresses with php?

I used the code to log it in my sql database called IP_LOG and my table is IP_COLLECT, but the input I keep on getting is ::1, is this because this is localhost or is there a step I am forgetting, here is my code:
<?php
$ip = $_SERVER['REMOTE_ADDR'];
mysql_connect('localhost','root','****');
mysql_select_db('IP_LOG');
mysql_query("INSERT INTO IP_COLLECT (IP_ADDR) VALUES ('$ip')");
?>
I am doing this because I was hacked through this port last week, and I need to see who has access to this port, and because I have a hunch it is my little brother
 
Back
Top