title: How to display selected value in combo box in php?
body: <p>I've written this code... but this fails to display text... not sure what's wrong with the code. I'm new to PHP and trying to create a page that gets customer details and puts it in SQL.</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body&gt;
  
  &lt;?php
  $initial=&quot;&quot;;
  ?&gt;
  
  &lt;form method=&quot;post&quot;
      action=&quot;&lt;?php echo htmlspecialchars($_SERVER[&quot;PHP_SELF&quot;]); ?&gt;&quot;&gt;
  
  Intials: &lt;select id=&quot;cmbInitial&quot; name=&quot;initial&quot; onchange=&quot;showUser(this.value)&quot;&gt;
      &lt;option value=&quot;0&quot;&gt;Select initial&lt;/option&gt;
      &lt;option value=&quot;1&quot;&gt;Mr.&lt;/option&gt;
      &lt;option value=&quot;2&quot;&gt;Mrs.&lt;/option&gt;
      &lt;option value=&quot;3&quot;&gt;Ms.&lt;/option&gt;
      &lt;option value=&quot;4&quot;&gt;M/s&lt;/option&gt;
  &lt;/select&gt; &lt;br&gt;
  &lt;br&gt;
  
  &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit&quot;&gt;&lt;/form&gt;
  &lt;br&gt;
  &lt;br&gt;
  
  &lt;?php
  echo &quot;Customer Intial: $initial &lt;br&gt;&quot;;
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>