title: Notice: Undefined index in select Option tag PHP
body: <blockquote>
    <p>Notice : Undefined index in Select option tag </p>
  </blockquote>
  
  <p>When i open this program on browser, the error "undefined index" appear in SELECT option (drop-down box). 
  Help me friends</p>
  
  <pre><code>&lt;label&gt;Your location&lt;span class="error"&gt;*&lt;/span&gt;:&lt;/label&gt;
      &lt;select name="loca"&gt;
        &lt;option label="Select"&gt;&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] == "Andaman and Nicobar Islands") echo "selected"; ?&gt;&gt;Andaman and Nicobar Islands&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] == "Andhra Pradesh") echo "selected"; ?&gt;&gt;Andhra Pradesh&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Arunachal Pradesh") echo "selected"; ?&gt;&gt;Arunachal Pradesh&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Assam") echo "selected"; ?&gt;&gt;Assam&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] == "Bihar") echo "selected"; ?&gt;&gt;Bihar&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] == "Chandigarh") echo "selected"; ?&gt;&gt;Chandigarh&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Chhattisgarh") echo "selected"; ?&gt;&gt;Chhattisgarh&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Dadra and Nagar Haveli") echo "selected"; ?&gt;&gt;Dadra and Nagar Haveli &lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Daman and Diu") echo "selected"; ?&gt;&gt;Daman and Diu&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Goa") echo "selected"; ?&gt;&gt;Goa&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Gujarat") echo "selected"; ?&gt;&gt;Gujarat&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Haryana") echo "selected"; ?&gt;&gt;Haryana&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Himachal Pradesh") echo "selected"; ?&gt;&gt;Himachal Pradesh&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Jammu and Kashmir") echo "selected"; ?&gt;&gt;Jammu and Kashmir&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Jharkhand") echo "selected"; ?&gt;&gt;Jharkhand&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Karnataka") echo "selected"; ?&gt;&gt;Karnataka&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Kerala") echo "selected"; ?&gt;&gt;Kerala&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Lakshadweep") echo "selected"; ?&gt;&gt;Lakshadweep&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Madhya Pradesh") echo "selected"; ?&gt;&gt;Madhya Pradesh&lt;/option&gt;
        &lt;option &lt;?php if($_POST["loca"] =="Maharashtra") echo "selected"; ?&gt;&gt;Maharashtra&lt;/option&gt;
     &lt;/select&gt;
      &lt;span class="error"&gt;&lt;?php echo $locationErr?&gt;&lt;/span&gt; &lt;br /&gt;
  </code></pre>