Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2016
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 7.93 KB | None | 0 0
  1. <html>
  2. <head>
  3. <!-- This includes the CSS into the script. -->
  4. <link href="main.css" rel="stylesheet" type="text/css">
  5. </head>
  6.     <body>
  7.         <!-- A wrapper is made to keep this content in line with each other. -->
  8.         <div class="wrapper">
  9.             <div class="container">
  10.                 <!-- We create a form for the user to select their options -->
  11.                 <form role ="form" action="#" method="post">
  12.                     <!-- This section is for the MALE  -->
  13.                     <b>Male Coat</b><br />
  14.                     <select name="male-coats">
  15.                       <option value="standard">Standard</option>
  16.                       <option value="short">Short</option>
  17.                       <option value="crested">Crested</option>
  18.                       <option value="silk">Silk</option>
  19.                     </select>
  20.                    
  21.                    
  22.             </div>
  23.         <!-- This section is for the FEMALE, a seperate container is used to place it next to the male on the webpage -->
  24.             <div class="container">
  25.                 <b>Female Coat</b><br />
  26.                 <select name="female-coats"> <!-- note that this has a seperate name to the male so that we can find the results below -->
  27.                   <option value="standard">Standard</option>
  28.                   <option value="short">Short</option>
  29.                   <option value="crested">Crested</option>
  30.                   <option value="silk">Silk</option>
  31.                 </select>
  32.  
  33.                
  34.             </div>
  35.         </div>
  36.  
  37.         <!-- New wrapper is made to post the following content BELOW the stuff above -->
  38.         <div class="wrapper">
  39.             <div class="container">
  40.             <!-- A submit button -->
  41.             <button type="submit" class="btn btn-default">Submit</button>
  42.                 </form>
  43.                 <?php
  44.  
  45.                
  46.                 // We are now asking if the submit button has been pressed, if YES then continue
  47.                 if ($_SERVER['REQUEST_METHOD'] == 'POST')
  48.                 {
  49.                     // We want a random number between 1-200 and put it in the variable $check
  50.                     $check = rand(1,200);
  51.  
  52.                     //If the male AND female coats standard
  53.                     if ($_POST['male-coats'] == 'standard' AND $_POST['female-coats'] == 'standard')
  54.                     {
  55.                         //make the result also standard
  56.                         $coats = 'Standard';
  57.                     }
  58.  
  59.                     //If Male is Standard and Female is Short
  60.                     elseif ($_POST['male-coats'] == 'standard' AND $_POST['female-coats'] == 'short')
  61.                     {
  62.                         //check if the random number is more than or equal to 1 AND less than or equal to 151
  63.                         if ($check >= 1 AND $check <= 151)
  64.                         {
  65.                             //if it is, Standard
  66.                             $coats = 'Standard';
  67.                         }
  68.                         //Otherwise if the number is more than 151
  69.                         elseif ($check > 151)
  70.                         {
  71.                             //Short
  72.                             $coats = 'Short';
  73.                         }
  74.                     }
  75.                     // We reverse the above to check if the FEMALE is now standard and the MALE is now short, results will be the same
  76.                     elseif ($_POST['female-coats'] == 'standard' AND $_POST['male-coats'] == 'short')
  77.                     {
  78.                        
  79.                         if ($check >= 1 AND $check <= 151)
  80.                         {
  81.                             $coats = 'Standard';
  82.                         }
  83.                         elseif ($check > 151)
  84.                         {
  85.                             $coats = 'Short';
  86.                         }
  87.                     }
  88.  
  89.                     elseif ($_POST['male-coats'] == 'standard' AND $_POST['female-coats'] == 'crested')
  90.                     {
  91.                        
  92.                         if ($check >= 1 AND $check <= 130)
  93.                         {
  94.                             $coats = 'Standard';
  95.                         }
  96.                         elseif ($check >= 131 AND $check <= 150)
  97.                         {
  98.                             $coats = 'Short';
  99.                         }
  100.                         elseif ($check >= 151)
  101.                         {
  102.                             $coats = 'Crested';
  103.                         }
  104.                     }
  105.                     elseif ($_POST['female-coats'] == 'standard' AND $_POST['male-coats'] == 'crested')
  106.                     {
  107.                        
  108.                         if ($check >= 1 AND $check <= 130)
  109.                         {
  110.                             $coats = 'Standard';
  111.                         }
  112.                         elseif ($check >= 131 AND $check <= 150)
  113.                         {
  114.                             $coats = 'Short';
  115.                         }
  116.                         elseif ($check >= 196)
  117.                         {
  118.                             $coats = 'Crested';
  119.                         }
  120.                     }
  121.                     elseif ($_POST['male-coats'] == 'standard' AND $_POST['female-coats'] == 'silk')
  122.                     {
  123.                        
  124.                         if ($check >= 1 AND $check <= 150)
  125.                         {
  126.                             $coats = 'Standard';
  127.                         }
  128.                         elseif ($check >= 151 AND $check <= 170)
  129.                         {
  130.                             $coats = 'Short';
  131.                         }
  132.                         elseif ($check >= 171 AND $check <= 195)
  133.                         {
  134.                             $coats = 'Crested';
  135.                         }
  136.                         elseif ($check >= 196)
  137.                         {
  138.                             $coats = 'Silk';
  139.                         }
  140.                     }
  141.                     elseif ($_POST['female-coats'] == 'standard' AND $_POST['male-coats'] == 'silk')
  142.                     {
  143.                        
  144.                         if ($check >= 1 AND $check <= 150)
  145.                         {
  146.                             $coats = 'Standard';
  147.                         }
  148.                         elseif ($check >= 151 AND $check <= 170)
  149.                         {
  150.                             $coats = 'Short';
  151.                         }
  152.                         elseif ($check >= 171 AND $check <= 195)
  153.                         {
  154.                             $coats = 'Crested';
  155.                         }
  156.                         elseif ($check >= 196)
  157.                         {
  158.                             $coats = 'Silk';
  159.                         }
  160.                     }
  161.                     elseif ($_POST['male-coats'] == 'short' AND $_POST['female-coats'] == 'short')
  162.                     {
  163.                        
  164.                         if ($check >= 1 AND $check <= 140)
  165.                         {
  166.                             $coats = 'Standard';
  167.                         }
  168.                         elseif ($check >= 141)
  169.                         {
  170.                             $coats = 'Short';
  171.                         }
  172.                     }
  173.                     elseif ($_POST['male-coats'] == 'short' AND $_POST['female-coats'] == 'crested')
  174.                     {
  175.                        
  176.                         if ($check >= 1 AND $check <= 110)
  177.                         {
  178.                             $coats = 'Standard';
  179.                         }
  180.                         elseif ($check >= 111 AND $check <= 160)
  181.                         {
  182.                             $coats = 'Short';
  183.                         }
  184.                         elseif ($check >= 161)
  185.                         {
  186.                             $coats = 'Crested';
  187.                         }
  188.                     }
  189.                     elseif ($_POST['female-coats'] == 'short' AND $_POST['male-coats'] == 'crested')
  190.                     {
  191.                        
  192.                         if ($check >= 1 AND $check <= 110)
  193.                         {
  194.                             $coats = 'Standard';
  195.                         }
  196.                         elseif ($check >= 111 AND $check <= 160)
  197.                         {
  198.                             $coats = 'Short';
  199.                         }
  200.                         elseif ($check >= 161)
  201.                         {
  202.                             $coats = 'Crested';
  203.                         }
  204.                     }
  205.                     elseif ($_POST['male-coats'] == 'short' AND $_POST['female-coats'] == 'silk')
  206.                     {
  207.                        
  208.                         if ($check >= 1 AND $check <= 120)
  209.                         {
  210.                             $coats = 'Standard';
  211.                         }
  212.                         elseif ($check >= 121 AND $check <= 150)
  213.                         {
  214.                             $coats = 'Short';
  215.                         }
  216.                         elseif ($check >= 151 AND $check <= 180)
  217.                         {
  218.                             $coats = 'Crested';
  219.                         }
  220.                         elseif ($check >= 181)
  221.                         {
  222.                             $coats = 'Silk';
  223.                         }
  224.                     }
  225.                     elseif ($_POST['female-coats'] == 'short' AND $_POST['male-coats'] == 'silk')
  226.                     {
  227.                        
  228.                         if ($check >= 1 AND $check <= 120)
  229.                         {
  230.                             $coats = 'Standard';
  231.                         }
  232.                         elseif ($check >= 121 AND $check <= 150)
  233.                         {
  234.                             $coats = 'Short';
  235.                         }
  236.                         elseif ($check >= 151 AND $check <= 180)
  237.                         {
  238.                             $coats = 'Crested';
  239.                         }
  240.                         elseif ($check >= 181)
  241.                         {
  242.                             $coats = 'Silk';
  243.                         }
  244.                     }
  245.                     elseif ($_POST['male-coats'] == 'crested' AND $_POST['female-coats'] == 'crested')
  246.                     {
  247.                             $coats = 'Standard';
  248.                     }
  249.                     elseif ($_POST['male-coats'] == 'crested' AND $_POST['female-coats'] == 'silk')
  250.                     {
  251.                        
  252.                         if ($check >= 1 AND $check <= 100)
  253.                         {
  254.                             $coats = 'Standard';
  255.                         }
  256.                         elseif ($check >= 101 AND $check <= 140)
  257.                         {
  258.                             $coats = 'Short';
  259.                         }
  260.                         elseif ($check >= 141 AND $check <= 175)
  261.                         {
  262.                             $coats = 'Crested';
  263.                         }
  264.                         elseif ($check >= 176)
  265.                         {
  266.                             $coats = 'Silk';
  267.                         }
  268.                     }
  269.                     elseif ($_POST['female-coats'] == 'crested' AND $_POST['male-coats'] == 'silk')
  270.                     {
  271.                        
  272.                         if ($check >= 1 AND $check <= 100)
  273.                         {
  274.                             $coats = 'Standard';
  275.                         }
  276.                         elseif ($check >= 101 AND $check <= 140)
  277.                         {
  278.                             $coats = 'Short';
  279.                         }
  280.                         elseif ($check >= 141 AND $check <= 175)
  281.                         {
  282.                             $coats = 'Crested';
  283.                         }
  284.                         elseif ($check >= 176)
  285.                         {
  286.                             $coats = 'Silk';
  287.                         }
  288.                     }
  289.                     elseif ($_POST['male-coats'] == 'silk' AND $_POST['female-coats'] == 'silk')
  290.                     {
  291.                        
  292.                         if ($check >= 1 AND $check <= 90)
  293.                         {
  294.                             $coats = 'Standard';
  295.                         }
  296.                         elseif ($check >= 91 AND $check <= 130)
  297.                         {
  298.                             $coats = 'Short';
  299.                         }
  300.                         elseif ($check >= 131 AND $check <= 170)
  301.                         {
  302.                             $coats = 'Crested';
  303.                         }
  304.                         elseif ($check >= 171)
  305.                         {
  306.                             $coats = 'Silk';
  307.                         }
  308.                     }
  309.  
  310.  
  311.                     echo '<br/><br/>';
  312.                     echo $check.'<br/>';
  313.                     echo $coats;
  314.                 }
  315.  
  316.                
  317.                 ?>
  318.                
  319.             </div>
  320.         </div>
  321.  
  322.        
  323.     </body>
  324. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement