Code: Select all
// Check if the referer is your site if not then add record
if (preg_match ("/www.holidaypropertyrentalportugal.org/i", "$HTTP_REFERER")) {
mysql_close($connection);
} else {
// If you cant resolve domain use IP address
if ($REMOTE_HOST == "") {
$host = $REMOTE_ADDR;
} else {
$host = $REMOTE_HOST;
}
if ($host == '67.15.16.30') // Kill link something
{} else {
if( empty( $HTTP_REFERER ) or '' == $HTTP_REFERER ) {
$HTTP_REFERER = 'No Referer';
}
$file2 = basename($PHP_SELF);
mysql_query ("INSERT INTO myStats (browser, date, host, referer, page, control_date) VALUES ('$browser','$date','$host','$HTTP_REFERER','$file2','$control_date' )");
}I have seen sites (e.g. Blogs) take my name from my PC and use it to welcome me even though I have not entered it.
How is this done, and is there any way to collect info like location, language and email?
This info would be great for compiling demographics on my visitors.