Prueba esto
Código PHP:
Ver original<?php
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<center>
<?php
if(isset($_POST['producto']) && isset($_POST['referencia'])) { $_SESSION['array'][]['producto']=$_POST['producto'];
$_SESSION['array'][]['referencia']=$_POST['referencia];
}
foreach($_SESSION['array'] as $array) { foreach($array as $clave=>$valor){
echo $clave . " " . $valor['producto'];
}
}
?>
<form name="formulario" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
Producto:<input type="text" name="producto"/>
Referencia:<input type="text" name="referencia"/><br/>
<input type="submit" value="Insertar"/>
</form>
</center>
</body>
</html>