Codice PHP:
<?php
session_start();
$nome = array('nome1', 'nome2', 'nome3', 'nome4');
if(!isset($_SESSION['precedenti']))
$_SESSION['precedenti']=array();
$_SESSION['precedenti'][] = array_rand($nome, 4);
?>
<html>
<head>
<title>Estrazioni</title>
<link rel="stylesheet" type="text/css" href="estrazioni.css" />
<style type="text/css">
</style>
</head>
<body>
<p align="right">
<?php echo date("H:i - d F Y") ?>
</p>
<div id="div2">
<fieldset><legend>Gli Estratti sono:</legend>
<?php
$n = count($_SESSION['precedenti'])-1;
for($i=$n; $i>=0; $i--){
foreach ($_SESSION['precedenti'][$i] as $value)
echo "{$nome[$value]}
";
if($i==$n)
echo "<hr>";
}
?>
</p>
</fieldset>
</body>
</html>