Silviyaa

Untitled

Apr 1st, 2021
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.34 KB | None | 0 0
  1.  
  2. <html>
  3.     <head>
  4.         <meta charset="UTF-8">
  5.         <title></title>
  6.        
  7.     <form method='post' action="zad_33.php"></form>
  8.     </head>
  9.     <body style="background-color: antiquewhite">
  10.            <?php include ("zad_33.php"); ?>
  11.         <h1 style="text-decoration:underline", style="text-align:cener"><i><b><p style='color: blue'>Pleas enter your information:</p></b></i></h1>
  12.        
  13.         <p style='color:  darkslateblue'> <i> City:</p><input type="text" name="city"></i>
  14.     <p style='color: darkslateblue'> <i> Month:</p><input type="text" name="month"></i>
  15. <p style='color: darkslateblue'> <i> Year:</p><input type="text" name="year"></i>
  16.    <?php // $inputLocal = array (city,) ?>
  17.         <br><br>
  18.         <p style="color: crimson ">
  19.         Pleas choose the kinds of weather you experienced from the list below.<br>
  20.         Choose all that apply.<br></p>
  21.          <?php
  22.        $weather = array("Sunchine", "Clouds", "Rain", "Hail", "Sleet","Snow","Wind","Cold","Heat");
  23.        ?>
  24.         <input type="checkbox" name="weather[]" value="sunshine" />Sunshine<br />
  25.         <input type="checkbox" name="weather[]" value="Clouds" />Clouds<br />
  26.         <input type="checkbox" name="weather[]" value="Rain" />Rain<br />
  27.         <input type="checkbox" name="weather[]" value="Hail" />Hail<br />
  28.         <input type="checkbox" name="weather[]" value="Sleet" />Sleet<br />
  29.         <input type="checkbox" name="weather[]" value="Snow" />Snow<br />
  30.         <input type="checkbox" name="weather[]" value="Wind" />Wind<br />
  31.         <input type="checkbox" name="weather[]" value="Cold" />Cold<br />
  32.         <input type="checkbox" name="weather[]" value="Heat" />Heat<br /><br>
  33.        
  34.         <input type="submit" value="Go" name="Go" />
  35.      
  36.        
  37.        
  38.        
  39.     </body>
  40. </html>
  41.  
  42. //---------------------------------------------------------------------------------
  43. <?php
  44. $inputLocal = array("city","month","year");
  45.  if(isset($_POST['weather[]'])){
  46. if(isset($_POST['Go'])){
  47.    
  48.     if(isset($_POST['city'])&&isset($_POST['month'])&&isset($_POST['year'])){
  49.  
  50.          $city = $_POST['city'];
  51.          $month = $_POST['month'];
  52.          $year = $_POST['year'];
  53.        
  54.          
  55.  
  56.          echo "In".$inputLocal[0]." in the month of".$inputLocal[1].$inputLocal[2].", you observed the following weather:";
  57. }}
  58. }
  59.  
  60.  
  61. ?>
  62.  
  63.  
Advertisement
Add Comment
Please, Sign In to add comment