Jump to content

PLEASE HELP URGENT


blamu2

Recommended Posts

<?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

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/236166-please-help-urgent/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.