Advertisement
absorr

Month Spell-Check

Jan 28th, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.19 KB | None | 0 0
  1. <?php
  2. $month = strtolower($_POST['month']);
  3. switch ($month)
  4. {
  5.     case "january":
  6.         echo "<h2>There are <strong>31 Days</strong> in January</h2>";
  7.         break;
  8.     case "february":
  9.         echo "<h2>There are <strong>28 Days</strong> in February</h2>";
  10.         break;
  11.     case "march":
  12.         echo "<h2>There are <strong>31 Days</strong> in March</h2>";
  13.         break;
  14.     case "april":
  15.         echo "<h2>There are <strong>30 Days</strong> in April</h2>";
  16.         break;
  17.     case "may":
  18.         echo "<h2>There are <strong>31 Days</strong> in May</h2>";
  19.         break;
  20.     case "june":
  21.         echo "<h2>There are <strong>30 Days</strong> in June</h2>";
  22.         break;
  23.     case "july":
  24.         echo "<h2>There are <strong>31 Days</strong> in July</h2>";
  25.         break;
  26.     case "august":
  27.         echo "<h2>There are <strong>30 Days</strong> in August</h2>";
  28.         break;
  29.     case "september":
  30.         echo "<h2>There are <strong>31 Days</strong> in September</h2>";
  31.         break;
  32.     case "october":
  33.         echo "<h2>There are <strong>30 Days</strong> in October</h2>";
  34.         break;
  35.     case "november":
  36.         echo "<h2>There are <strong>31 Days</strong> in November</h2>";
  37.         break;
  38.     case "december":
  39.         echo "<h2>There are <strong>30 Days</strong> in December</h2>";
  40.         break;
  41.     case "jaunary":
  42.     case "jarnauy":
  43.     case "janary":
  44.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  45.         <form method="post" id="monthForm">
  46.             <input type="hidden" name="month" value="January" />
  47.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>January</strong>?</a></h4>
  48.         </form>';
  49.         break;
  50.     case "febuary":
  51.     case "feburary":
  52.     case "febarary":
  53.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  54.         <form method="post" id="monthForm">
  55.             <input type="hidden" name="month" value="February" />
  56.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>February</strong>?</a></h4>
  57.         </form>';
  58.         break;
  59.     case "marh":
  60.     case "marc":
  61.     case "mrch":
  62.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  63.         <form method="post" id="monthForm">
  64.             <input type="hidden" name="month" value="March" />
  65.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>March</strong>?</a></h4>
  66.         </form>';
  67.         break;
  68.     case "abril":
  69.     case "aprl":
  70.     case "apral":
  71.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  72.         <form method="post" id="monthForm">
  73.             <input type="hidden" name="month" value="April" />
  74.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>April</strong>?</a></h4>
  75.         </form>';
  76.         break;
  77.     case "mahy":
  78.     case "my":
  79.     case "ay":
  80.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  81.         <form method="post" id="monthForm">
  82.             <input type="hidden" name="month" value="May" />
  83.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>May</strong>?</a></h4>
  84.         </form>';
  85.         break;
  86.     case "juno":
  87.     case "jun":
  88.     case "joon":
  89.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  90.         <form method="post" id="monthForm">
  91.             <input type="hidden" name="month" value="June" />
  92.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>June</strong>?</a></h4>
  93.         </form>';
  94.         break;
  95.     case "jul":
  96.     case "julie":
  97.     case "jly":
  98.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  99.         <form method="post" id="monthForm">
  100.             <input type="hidden" name="month" value="July" />
  101.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>July</strong>?</a></h4>
  102.         </form>';
  103.         break;
  104.     case "agust":
  105.     case "augst":
  106.     case "augist":
  107.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  108.         <form method="post" id="monthForm">
  109.             <input type="hidden" name="month" value="August" />
  110.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>August</strong>?</a></h4>
  111.         </form>';
  112.         break;
  113.     case "septembr":
  114.     case "septimber":
  115.     case "siptember":
  116.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  117.         <form method="post" id="monthForm">
  118.             <input type="hidden" name="month" value="September" />
  119.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>September</strong>?</a></h4>
  120.         </form>';
  121.         break;
  122.     case "oktober":
  123.     case "ahtober":
  124.     case "octobr":
  125.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  126.         <form method="post" id="monthForm">
  127.             <input type="hidden" name="month" value="October" />
  128.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>October</strong>?</a></h4>
  129.         </form>';
  130.         break;
  131.     case "novamber":
  132.     case "novembir":
  133.     case "novembr":
  134.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  135.         <form method="post" id="monthForm">
  136.             <input type="hidden" name="month" value="November" />
  137.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>November</strong>?</a></h4>
  138.         </form>';
  139.         break;
  140.     case "decenber":
  141.     case "dicember":
  142.     case "decembr":
  143.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>
  144.         <form method="post" id="monthForm">
  145.             <input type="hidden" name="month" value="December" />
  146.             <h4><a onclick="document.forms[\'monthForm\'].submit();">Did you mean <strong>December</strong>?</a></h4>
  147.         </form>';
  148.         break;
  149.     default:
  150.         echo '<h2>"'.$_POST['month'].'" is not a valid month.</h2>';
  151. }
  152. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement