title: Using Form POST and GET together for selected attribute
body: <p>I have a filter on MySQL query. I can filter entries as I want. But after filtering, I cannot set values as selected on option value. My code;</p>
  
  <pre><code>&lt;form method="POST"&gt;
      &lt;label&gt;İller:&lt;/label&gt;&lt;select style="width:150px" name="iller"&gt; 
          &lt;OPTION VALUE=''&gt;Hepsi&lt;/OPTION&gt;
          &lt;option value="İstanbul"&gt;İstanbul&lt;/option&gt;
          &lt;option value="Ankara"&gt;Ankara&lt;/option&gt;
          &lt;option value="Bolu"&gt;Bolu&lt;/option&gt;
      &lt;/select&gt;
      &lt;label&gt;Bölümler:&lt;/label&gt;&lt;select style="width:150px" name="bolum"&gt; 
          &lt;OPTION VALUE=''&gt;Hepsi&lt;/OPTION&gt;
          &lt;option value="Makine Mühendisliği"&gt;Makine Mühendisliği&lt;/option&gt;
          &lt;option value="Endüstri Mühendisliği"&gt;Endüstri Mühendisliği&lt;/option&gt;
          &lt;option value="Elektrik Mühendisliği"&gt;Elektrik Mühendisliği&lt;/option&gt;
      &lt;/select&gt;
      &lt;input class="button" type="submit" name="submit" value="Filtrele" /&gt;&lt;/td&gt;
  &lt;/form&gt;
  
  &lt;?php   
      $db_connection = mysqli_connect($host,$user,$password,$dbname);
      $query="SELECT * FROM osym";
      $sql=$query;
      $iller = $_POST['iller'];
      $bolum = $_POST['bolum'];
  
      mysqli_real_escape_string($db_connection,$_POST['iller']);
      mysqli_real_escape_string($db_connection,$_POST['bolum']);
      $conditions = array();
  
      if($iller !="") {
          $conditions[] =  " Il='$iller'";
      }
      if($bolum !="") {
          $conditions[] =  " Bolum='$bolum'";
      }
      if (count($conditions) &gt; 0) {
          $sql .= " WHERE " . implode(' AND ', $conditions);
      }
      echo "&lt;table border='1'&gt;
            &lt;tr&gt;
              &lt;th&gt;Kod&lt;/th&gt;
              &lt;th&gt;İl&lt;/th&gt;
              &lt;th&gt;Okul&lt;/th&gt;
              &lt;th&gt;Bölüm&lt;/th&gt;
              &lt;th&gt;Dili&lt;/th&gt;
              &lt;th&gt;Öğretim&lt;/th&gt;
              &lt;th&gt;Burs&lt;/th&gt;
              &lt;th&gt;Kontenjan&lt;/th&gt;
              &lt;th&gt;Puan Türü&lt;/th&gt;
              &lt;th&gt;Sıra&lt;/th&gt;
              &lt;th&gt;Taban P.&lt;/th&gt;
              &lt;th&gt;Tavan P.&lt;/th&gt;
            &lt;/tr&gt;";
  
      mysqli_query($db_connection,"SET NAMES UTF8");
      if (isset($_POST['submit'])) {
          $result = mysqli_query($db_connection,$sql);
              while($row = mysqli_fetch_array($result)) {
                  echo "&lt;tr&gt;";
                  echo "&lt;td&gt;" . $row['Kod'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['Il'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['Okul'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['Bolum'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['Dili'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['Ogr'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['Burslu'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['Kontenjan'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['PuanT'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['Sira'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['TabPuan'] . "&lt;/td&gt;";
                  echo "&lt;td&gt;" . $row['TavPuan'] . "&lt;/td&gt;";
                  echo "&lt;/tr&gt;";
              }
  
              echo "&lt;/table&gt;";
      }
  ?&gt;
  </code></pre>
  
  <p>Whenever I select an option and hit 'Filtrele' button, all option names return to "Hepsi". </p>
  
  <p>I have tried putting </p>
  
  <pre><code>&lt;?php if ($iller="İstanbul") {echo "selected"; } ?&gt; 
  </code></pre>
  
  <p>in </p>
  
  <pre><code>&lt;option value="İstanbul"&gt; 
  </code></pre>
  
  <p>tag but it didn't work. </p>
  
  <p>Because of method, i cannot use GET attribute either. I am looking for your help, thanks in advance.</p>