SHARE
TWEET

Untitled

a guest May 27th, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6.     <meta http-equiv="X-UA-Compatible" content="ie=edge">
  7.     <title>Document</title>
  8. </head>
  9. <body>
  10.     <form action="miasto.php">
  11.     <p><label>Imie: <input type="text" name="fname" size="20" maxlength="40"/></label></p>
  12.     <p><label>Naziwsko: <input type="text" name="sname" size="20" maxlength="40"/></label></p>
  13.     <?php
  14.  
  15.     $miasto = [1=>'Warszawa','Wrocław', 'Szczecin', 'Kielce', 'Białystok', 'Kraków','Ząbki', 'Łódź','Poznań', 'Częstochowa','Gdańsk','Gdynia','Sopot' ,'Radom','Kobyłka', 'Giżycko', 'Częstochowa', 'Puławy', 'Wołomin','Piaseczno'];
  16.     echo '<p> twoje miasto to: <select name="miasto"></p>';
  17.     foreach ($miasto as $key => $value)
  18.     {
  19.         echo "<option value=\"$value\">$value</option>\n";
  20.     }
  21.     echo '</select>';
  22.     echo '<p> twoej wojwodztwo to: <select name="województwa"></p>';
  23.     $województwa = [1=>'Mazowieckie', 'pomorske','zachodnio-pomorskie', 'lubelskie', 'podkarpackie', 'śląskie' , 'świętokrzyskie', 'lubuskie', 'wielkoposlkie', 'małopolskie'];
  24.     foreach ($województwa as $key => $value)
  25.     {
  26.         echo "<option value=\"$value\">$value</option>\n";
  27.     }
  28.     echo '</select>';
  29.     ?>
  30.         <p><input type="submit" name="submit" value="Wyslij dane"></p>
  31. </form>
  32. <?php
  33. if(!empty($_REQUEST['miasto']))
  34. {
  35.     $miasto = $_REQUEST ['miasto'];
  36.     echo "<p> Twoje miasto to: $miasto</p>";
  37. }
  38.  
  39. if(!empty($_REQUEST['województwa']))
  40.     {
  41.         $województwa = $_REQUEST ['województwa'];
  42.         echo "<p> Twoje województwo to: $województwa</p>";
  43.     }
  44.  
  45. if(!empty($_REQUEST['fname']))
  46.     {
  47.         $fname= $_REQUEST['fname'];
  48.         echo "<p> Twoje imie to: $fname</p>";
  49.     }
  50.     else
  51.     {
  52.         $fname = NULL;
  53.         echo '<p> nie podales imienie</p>';
  54.     }
  55.     if(!empty($_REQUEST['sname']))
  56.     {
  57.         $sname= $_REQUEST['sname'];
  58.         echo "<p> Twoje imie to: $sname</p>";
  59.     }
  60.     else
  61.     {
  62.         $sname = NULL;
  63.         echo '<p> nie podales naziwska</p>';
  64.     }
  65. ?>
  66. </body>
  67. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top