Thanks Bee, i will look up the description of the function you gave.
currently i managed to program this:
// get the referer of the user
$ref_url = $_SERVER['HTTP_REFERER'];
// set current date
$current_date = date("Y-m-d");
// Assign positive value to $own_site if users come from mydomain.net
if ($ref_url) { // if there is a referrer
$url = parse_url($ref_url);
$own_site = $url['host']; // then get the domain of the referrer string
if ($own_site == 'www.mydomain.net') { $own_site = 'yes'; }
}
// If no referer, than standard value is no_ref
if (!$ref_url) { $ref_url = "no_ref"; }
// build a query
$query4 = "UPDATE ref_count SET ref_count = ref_count+1 WHERE referer = '$ref_url' AND date = '$current_date'";
// execute query if user comes not from own site
if ($own_site != 'yes') { mysql_query("$query4") or die(mysql_error()); }