Visitor stats
Posted: Wed Oct 01, 2003 2:44 pm
I want to record the refering site to a db to see where people are coming from. I am using this to find the referer
and this to store the info to the database, which works as expected.
This will currently create a new line in the database even if the referer already exists. How do I alter this to update a column called hits if the referer already exists in the database
Code: Select all
<?php
$refer = $_SERVER['HTTP_REFERER'] ;
?>Code: Select all
<?php
if ( !isset($refer) == true) {$refer = 'Bookmark or Other'; }
$refer = "INSERT INTO stats_referer(referer) VALUES ('$refer')";
$result = mysql_query($refer, $skinz);
?>