<?php
$possibles[];
$alreadychosen[];
for ($i = 0; $i<20;$i++) $possibles =i+1;
for (int $i = 0; $i<8; $i++)
{
$boolean= false;
$randIndex=0;
do
{
$randIndex = rand(1,20);
for ($j = 0; $j< $i && !$hasInt; $j++)
{
if ($possibles[$randIndex] == $alreadyChosen[$j])
{
$hasInt = true;
}
}
} while ($hasInt);
{
$alreadyChosen = $possibles[randIndex];
echo($alreadyChosen);
}
for ($i = 0; $i<8;$i++)
{
if($alreadyChosen<10)
{
echo ('<a href="/mp/info130'+$i+'.htm"><img src="/mp/p130'+$i+'-1.jpg" height=180 width=120 align=left hspace=0 vspace=2 border=0 class=TopImages></a>');
}
else if($alreadyChosen>10)
{
echo ('<a href="/mp/info13'+$i+'.htm"><img src="/mp/p13'+$i+'-1.jpg" height=180 width=120 align=left hspace=0 vspace=2 border=0 class=TopImages></a>');
it should select 8 images out of 20 but don't repeat please