Ok Sencillo en cada enlace, ejemplo:
index.html
Código HTML:
<a href="sumador.php?check=1" target="_self">Foros del Web</a>
<a href="sumador.php?check=2" target="_self">Google</a>
<a href="sumador.php?check=3" target="_self">Youtube</a>
<a href="sumador.php?check=4" target="_self">Facebook</a>
<a href="sumador.php?check=5" target="_self">Twitter</a>
Sumador.php
Código PHP:
$id = $_GET[check];
$sql="UPDATE visitas SET pagina = pagina + 1 where id=".$id."";
mysql_query($sql,$link);
if($id==1){
echo"<SCRIPT>location.href = 'http://www.forosdelweb.com';</SCRIPT>";
}
if($id==2){
echo"<SCRIPT>location.href = 'http://www.google.com';</SCRIPT>";
}
if($id==3){
echo"<SCRIPT>location.href = 'http://www.youtube.com';</SCRIPT>";
}
if($id==4){
echo"<SCRIPT>location.href = 'http://www.facebook.com';</SCRIPT>";
}
if($id==5){
echo"<SCRIPT>location.href = 'http://www.twitter.com';</SCRIPT>";
}
Que es lo que hacen:
index.html
Este archivo tendra los enlaces, que todos enviaran a sumador.php, pero solo enviaran una variable en la URL
sumador.php
Recibe la variable check, que es una variable de URL, la asigna a la variabla $id
hace un update en la tabla visitas, donde pagina es un valor int, el update sumara en el campo pagina, donde el id sea igual a la variable $id, tu deseas que numero de variable enviarle.
despues del update, los if's checan a cuanto equivalen y asi deciden donde enviar automaticamente
cualquier duda estoy pendiente del tema