Advertisement
Guest User

Steen Papier Schaar

a guest
Sep 26th, 2010
503
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.98 KB | None | 0 0
  1. <?php
  2.  
  3. // Script made by BramBoos, only use for non-commercial use.
  4.  
  5. if ($_SERVER['REQUEST_METHOD'] == 'POST')
  6.     {
  7.         $random_1 = rand(1, 3);
  8.            
  9.             if ($random_1 == '1' && $_POST['id'] == '1')
  10.                 {
  11.                 $uitslag = '0';
  12.                 }
  13.                
  14.             elseif ($random_1 == '1' && $_POST['id'] == '2')
  15.                 {
  16.                 $uitslag = '2';
  17.                 }
  18.                
  19.             elseif ($random_1 == '1' && $_POST['id'] == '3')
  20.                 {
  21.                 $uitslag = '1';
  22.                 }
  23.            
  24.             elseif ($random_1 == '2' && $_POST['id'] == '1')
  25.                 {
  26.                 $uitslag = '1';
  27.                 }
  28.                
  29.             elseif ($random_1 == '2' && $_POST['id'] == '2')
  30.                 {
  31.                 $uitslag = '0';
  32.                 }
  33.                
  34.             elseif ($random_1 == '2' && $_POST['id'] == '3')
  35.                 {
  36.                 $uitslag = '2';
  37.                 }
  38.            
  39.             //,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
  40.            
  41.             elseif ($random_1 == '3' && $_POST['id'] == '1')
  42.                 {
  43.                 $uitslag = '2';
  44.                 }
  45.                
  46.             elseif ($random_1 == '3' && $_POST['id'] == '2')
  47.                 {
  48.                 $uitslag = '1';
  49.                 }
  50.                
  51.             elseif ($random_1 == '3' && $_POST['id'] == '3')
  52.                 {
  53.                 $uitslag = '0';
  54.                 }
  55.    
  56.     }
  57. ?>
  58.  
  59.                 <html>
  60.                     <head>
  61.                         <title>Steen, papier, schaar</title>
  62.                     </head>
  63.                         <body>
  64.                            
  65.                                 <?php
  66.                                     if (!empty($uitslag))
  67.                                     {
  68.                                    
  69.                                         if ($uitslag == '0')
  70.                                             {
  71.                                                 echo'Gelijk!';
  72.                                             }
  73.                                         elseif ($uitslag == '1')
  74.                                             {
  75.                                             echo'Verloren';
  76.                                             }
  77.                                         elseif ($uitslag == '2')
  78.                                             {
  79.                                                 echo'Gewonnen';
  80.                                             }
  81.                                             echo '<br /><br /> <a href="">Speel opnieuw</a>';
  82.                                     }
  83.                                         else
  84.                                             {
  85.                                 ?>
  86.                                                 <form method="POST">
  87.                                                     <select name="id">
  88.                                                         <option value="1">Steen</option>
  89.                                                         <option value="2">Papier</option>
  90.                                                         <option value="3">Schaar</option>
  91.                                                     </select>
  92.                                
  93.                                                         <input type="submit" value="SPEEL!"/>
  94.                                                 </form>
  95.                                         <?php
  96.                                             }
  97.                                         ?>
  98.                            
  99.                         </body>
  100.                 </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement