<?php
include("top.html");
include("shared.php");
$continent_query = "SELECT DISTINCT continent FROM countries ORDER BY continent";
$language_query = "SELECT DISTINCT language FROM languages
                   WHERE official = 'T' ORDER BY language";
?>

    <p>Choose characteristics of a developing nation you'd like to visit.</p>

    <form action="recommendations.php" method="get">
      <div>
        <h2>Which continent and language(s) do you prefer?</h2>

        <select name="continent" size="5">
          <?php foreach (perform_query($continent_query) as $row) { ?>
            <option><?= $row["continent"] ?></option>
          <?php } ?>
        </select>

        <select name="languages[]" size="5" multiple="multiple">
          <?php foreach (perform_query($language_query) as $row) { ?>
            <option><?= $row["language"] ?></option>
          <?php } ?>
        </select>
      </div>

      <div><input type="submit" value="Submit" /></div>
    </form>
  </body>
</html>
