I thought I’d post this code I use on some of my sites. Basically when someone finds your site from another site it emails you and tells you where they came from. I know stats software is much more powerful but this is quite nice as it’s in real time.
if( !empty( $_SERVER[ "HTTP_REFERER" ] ) && substr_count( $_SERVER[ "HTTP_REFERER" ], “www.yourdomain” ) == 0 ) {
$subject = “Someone has found YOUR WEBSITE NAME HERE”;
$m = $_SERVER[ "HTTP_REFERER" ] . “\n” . $_SERVER[ "REQUEST_URI" ] . “\n”;
$m .= “\n\nMessage sent on ” . date( “H:i:s, d/m/Y” );
$headers = “From: Your website name <contact@yourdomain.com> Reply-To: Your website name <contact@yourdomain.com>n”;
$to = “youremail@yourdomain.com”;
mail( $to, $subject, $m, $headers );
}
Although I’ve spent a lot of time reading the mails during the working day it gives you a good idea of how and when people find your site.


thanks,
Although then I add it to my blog it break it since some use of “ which php doesn’t like.
P.S
Since it doesn’t tell you what is the previous to the referer I got here since you list in the sponsor of Durian.
What is the purpose of the registration if the users cannot edit their posts?