Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.
Hey,
Just a quick question, this time: does anyone know what the exact limitations are when I collect someone's IP with $_SERVER['REMOTE_ADDR']?
For example:
I was wondering about this while setting up a table for a database. The table will contain data of registered users: id, name, password, ip, etc.
Any tips?
According to Wikipedia, an IPv6 address looks like this (each line being the same address):
2001:0db8:0000:0000:0000:0000:1428:57ab
2001:0db8:0000:0000:0000::1428:57ab
2001:0db8:0:0:0:0:1428:57ab
2001:0db8:0:0::1428:57ab
2001:0db8::1428:57ab
2001:db8::1428:57ab
Do you really need to set exact limitations?
Here's a function that I use instead of just getting the REMOTE_ADDR:
function GetRealIP() {
$check = array('HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED','HTTP_VIA', 'HTTP_X_COMING_FROM', 'HTTP_COMING_FROM', 'HTTP_CLIENT_IP', 'REMOTE_ADDR');
$length = count($check);
for($i=0; $i<$length; $i++) {
$item = $check[$i];
if($found = $_SERVER[$item]) return $found;
}
}
1 to 5 of 5