$pag=$_SERVER['REQUEST_URI'];
$_SESSION['pagine'][]=$pag;
$_SESSION['titolo'][]=$tit;

$num=count($_SESSION['pagine']);

for ($a=0;$a < $num;$a++){
?>

<a href="<?=$_SESSION['pagine'][$a];?>&elemento=<?=$a;?>
&tit=<?=$_SESSION['titolo'][$a];?>">
<?=$_SESSION['titolo'][$a];?></a>



<? }?>

.... dove è neretto vi è l'errore ....