How to keep selected item in dropdown list in php?
<p>I am using this code to switch language in my website. Everything works fine but when I change language always first item is selected. I want to keep selected which language is website language. Here is my code.</p>

<pre><code>&lt;td width="85%" align=right class=top_section&gt; 
          &lt;form method='POST'&gt;
          &lt;select name="switchlanguage" onchange="this.form.submit()"&gt; 
          &lt;option value="en" &lt;?php if($_POST['switchlanguage'] == 'en') echo 'selected';?&gt;English&lt;/option&gt; 
          &lt;option value="ru" &lt;?php if($_POST['switchlanguage'] == 'ru') echo 'selected';?&gt;Русский&lt;/option&gt; 
          &lt;option value="tj" &lt;?php if($_POST['switchlanguage'] == 'tj') echo 'selected';?&gt;Точики&lt;/option&gt; 
          &lt;/select&gt; 

    &lt;/form&gt;
    &lt;/td&gt;
</code></pre>

<p>How to make it work properly? If russian language is selected it should stay in russian. But it always goes to English.</p>

<p>And using this code to change website language</p>

<pre><code>if(!isset($_POST['switchlanguage']))
  {
  include_once($DOCUMENT_LANG.'en.lng.php');
  }
  else
  {
  include_once($DOCUMENT_LANG.$_POST['switchlanguage'].'.lng.php');
  }
</code></pre>

<p>Even when I use tab to enter dropdownbox and using down key, it is automatically goes to first item.</p>
