I am trying to get track of how many times users click on the links on my site. I have one file that I call click.php. This is how it looks:
<?
$db=mysql_connect("localhost","user","");
mysql_select_db("database_name",$db);
// clickcount is the table, with 2 columns: id and clicks
$sql="UPDATE clickcount SET click=click+1 WHERE (id = '$id')";
$result=mysql_query($sql,$db);
header("Location: http://$url");
exit;
?>
Where the link is I write like this:
<a href="click.php?urlhttp://www.test.com&id=3" target=_blank">Testlänk</a>
This is the error I get:
Warning: Cannot add header information - headers already sent by (output started at C:/apache/htdocs/links/click.php:1) in C:/apache/htdocs/links/click.php on line 8
Please help me and forgive me for my bad english. Hope you can understand me.
//Jessica