OK...
Now I got it.
My menu links to this file in an IMG command.
<?php
$cookiename = 'CookieCounter';
if( isset( $_COOKIE[$cookiename] ) ){$value = $_COOKIE[$cookiename];}
else {
$temp='temp';
setcookie( $cookiename, $temp, time()+315360000);
header("Location: CookieSet.php");
;}
?>
Now the cookie is set, and it opens this file.
<?php
require("CounterSetup.php");
$conn = mysql_connect("$dbhost", "$dbuser", "$dbpass");
mysql_select_db("$dbname");
$cookiename = 'CookieCounter';
if( isset( $_COOKIE[$cookiename] ) ){
mysql_query ("INSERT INTO CountUser (Dato) VALUES (now())");
$id = mysql_insert_id();
setcookie( $cookiename, $id, time()+315360000);
;}
else {}
?>
If the cookie was set on the computer, it puts the data in my database, if the cookie for some reason wasn't set, it doesn't put data in the base.
So now it only count visiters that successfully sets a cookie, and it only counts them one time in the 10 years the cookie is on their computer.
It works :o))
thanks alot
Michael