login  Naam:   Wachtwoord: 
Registreer je!
 Scripts:

Scripts > PHP > Overige scripts > Random lotto

Random lotto

Auteur: Bluesi - 30 maart 2005 - 15:40 - Gekeurd door: Joel - Hits: 9652 - Aantal punten: 5.00 (1 stem)




Een script die 6 lottocijfers weergeeft + een reserve.

Code:
  1. <html>
  2. <head>
  3. <title>Lotto</title>
  4. </head>
  5. <body>
  6. <h1>De Winnende Lotto-getallen</h1>
  7. <?php
  8. // array lotto
  9. $lottonummers = range (1,42);
  10. shuffle($lottonummers);
  11. echo "<strong><u>De winnende nummers zijn:</u></strong><br /><br /> \n";
  12. for($i=0; $i<6;$i++)
  13. {
  14. echo "Nr: " . ($i+1) . ": " . "<strong>".$lottonummers[$i]."</strong>" . "<br> \n";
  15. $lottokleur[$lottonummers[$i]-1]="green";
  16. }
  17. echo "<br />";
  18. echo "<strong><u>Het reserve getal is:</u></strong> \n" . $lottonummers[41];
  19. // Array RESERVEGETAL Tabel 1
  20. $lottokleur[$lottonummers[41]-1]="red";
  21. echo "<table align=\"center\" cellspacing=\"0\" cellpadding=\"10\" style=\"border: 3px solid black\"> \n";
  22. for ($y=0;$y<6;$y++)
  23. {
  24. echo "<tr> \n";
  25. for ($x=0;$x<7;$x++)
  26. {
  27. echo "<td bgcolor=" . $lottokleur[($y*7)+ $x] . ">" . (($y*7) + $x+1) . "</td> \n";
  28. }
  29. echo "</tr>";
  30. }
  31. echo "</table>";
  32. ?>
  33. </body>
  34. </html>
Download code! Download code (.txt)

 Bekijk een voorbeeld van dit script!
 Stemmen
Niet ingelogd.

 Reacties
Post een reactie
Lees de reacties (2)
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.023s