function get_num() { $num = 0; $file = "forum/$num/not.txt"; while (file_exists($file)) { ++$num; $file = "forum/$num/not.txt"; } return $num; } function get_seed() { $f = "forum/seed.txt"; $seed = file_get_contents($f); ++$seed; unlink($f); $fp = fopen($f, 'w'); fwrite($fp, $seed); fclose($fp); return $seed; } echo '
'; $not=get_num(); $bg[0]="#FF0000"; $bg[1]="#000000"; $bg[2]="#FFFFFF"; $tit[0]="#000000"; $tit[1]="#FFFFFF"; $tit[2]="#FF0000"; $aut[0]="#FFFFFF"; $aut[1]="#FF0000"; $aut[2]="#000000"; for ($i=0; $i<$not; ++$i) { srand(get_seed()); $file = "forum/$i/not.txt"; $text = file_get_contents($file); $dades = explode("$",$text); echo ''; } echo '

'.$dades[1].'

'.$dades[0].'


Envia el teu post
';