Code


[php]

echo “Current date and time: “;
echo date(“l dS of F Y h:i:s A”);
echo “[br/]Client IP=”. get_ip_address();
echo “[br/]BrowserID=”.$_SERVER[‘HTTP_USER_AGENT’];

function get_ip_address() {
foreach (array(‘HTTP_CLIENT_IP’, ‘HTTP_X_FORWARDED_FOR’, ‘HTTP_X_FORWARDED’, ‘HTTP_X_CLUSTER_CLIENT_IP’, ‘HTTP_FORWARDED_FOR’, ‘HTTP_FORWARDED’, ‘REMOTE_ADDR’) as $key) {
if (array_key_exists($key, $_SERVER) === true) {
foreach (explode(‘,’, $_SERVER[$key]) as $ip) {
if (filter_var($ip, FILTER_VALIDATE_IP) !== false) {
return $ip;
}
}
}
}
}
[/php]