guest information

kaits

Mitglied
How to get all information about guests on my homepage and show this information on the page?
Screen size, colors, OP system, language, IP, HOST, etc
 
Why not using cookies? Get the user to specify his environment information once and save this information into a cookie to use it again whenever the user comes back.
 
It is possible to find out the language or rather the country your visitor comes from by doing a RIPE request. Sample code:

PHP:
function IPtoCountry($ip)
{
	$sock = fsockopen("whois.ripe.net", 43);
	fwrite($sock, $ip."\n");
	while (!feof($sock)) {
		$info .= fgetc($sock);
	}
	fclose($sock);
	preg_match("/country:[ ]+([A-Z]{2})\n/", $info, $match);
	return $match[1];
}

This function takes the IP address as an parameter and returns a two letter country code.

The system can be found out by analyzing the headers sent by the visitor's browser.

I would suggest you to use a script like PowerPhlogger. You can find information about it at http://www.phpee.com/
 
Zurück