Help with IP inserting?

Status
Not open for further replies.

rbxlmadx

Member
Messages
32
Reaction score
1
Points
8
So I want to track IPs, but when I do this:

$IP = $_SERVER['REMOTE_ADDR'];

mysql_query("INSERT into `ips` (`ip`, `username`) VALUES('$IP', '$my->username')");

The username shows up right, but the IP shows up as four numbers, like so; 1111 and not an actual IP address; 111.111.11
 

AngusThermopyle

Active Member
Messages
319
Reaction score
52
Points
28
How is the field 'ip' defined?
It should be a CHAR(15) or something similar.

You could insert code to print out $IP just to be sure the problem isn't with that.
 
Status
Not open for further replies.
Top