Código PHP:
<?php
unset($_COOKIE['pagina']);
$fecha = time() + (48*60*60);
$valor3 = $_GET['valor'];
$valor2 = str_replace(".", "", $valor3);
$valor = str_replace(",", ".", $valor2);
setcookie ( 'pagina', ++$valor, $fecha, '', 'www.pagina.comli.com', 0);
header ("Location: index.php");
?>
Código HTML:
<form action="metecookie.php" method="post" name="pagina1"> <input type="hidden" value="1" name="valor" /> <a href="#" onclick="javascript:document.pagina1.submit();" class="myriad" style="text-decoration:none; font-size:18px;">1</a> </form> <form action="metecookie.php" method="post" name="pagina2"> <input type="hidden" value="2" name="valor" /> <a href="#" onclick="javascript:document.pagina2.submit();" class="myriad" style="text-decoration:none; font-size:18px;">2</a> etc..... </form>