title: if(isset($_POST['submit'])) coding form action is not working
body: <p>hi im a beginner in php and mysql here if have a problem, it's either my isset post submit is not working or i have some errors in my coding, can anyone tell me what have i missed in my coding? thank you in advance :)</p>
  
  <p>this is my php:</p>
  
  <pre><code>&lt;?php
  $servername = "localhost";
  $username = "root";
  $password = "";
  $dbname = "tempahperalatan";
  
  // Create connection
  $conn = mysqli_connect($servername, $username, $password, $dbname);
  // Check connection
  if (!$conn) {
      die("Connection failed: " . mysqli_connect_error());
  }
  
  if (isset($_POST['submit'])) {
  
      $pemohon = $_POST['namaPemohon'];
      $trkhMula = $_POST['tmula'];
      $trkhAkhir = $_POST['takhir'];
      $n_program = $_POST['namaProgram'];
      $lokasi = $_POST['lokasi'];
      $n_anjuran = $_POST['namaAnjuran'];
      $catatan = $_POST['catatan'];
  
      $sql = "INSERT INTO daftartempah (pemohon, trkhMula, trkhAkhir, n_program, lokasi, n_anjuran, catatan) VALUES ('$namaPemohon', '$tmula', '$takhir', '$namaprogram', '$lokasi', '$namaAnjuran', '$catatan')";
  
      if (mysqli_query($conn, $sql)) {
          echo "New record created successfully";
      } else {
          echo "Error: " . $sql . "&lt;br&gt;" . mysqli_error($conn);
      }
  }
  
  
  mysqli_close($conn);
  ?&gt; 
  </code></pre>
  
  <p>and this is my form: </p>
  
  <pre><code>&lt;form action="page1.php" method="POST"&gt;
  
      &lt;div class="form-group row text-left"&gt;
          &lt;label for="example-text-input" class="col-2 col-form-label"&gt;Nama Pemohon: &lt;/label&gt;
          &lt;div class="col-10"&gt;
              &lt;input class="form-control" type="text" name="namaPemohon" id="namaPemohon"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group row text-left"&gt;
          &lt;label for="example-date-input" class="col-2 col-form-label"&gt;Tarikh Mula: &lt;/label&gt;
          &lt;div class="col-10"&gt;
              &lt;input class="form-control" type="date" value="0000-00-00" name="tmula" id="tmula"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group row text-left"&gt;
          &lt;label for="example-date-input" class="col-2 col-form-label"&gt;Tarikh Akhir: &lt;/label&gt;
          &lt;div class="col-10"&gt;
              &lt;input class="form-control" type="date" value="0000-00-00" name="takhir" id="takhir"&gt;
          &lt;/div&gt;
      &lt;/div&gt;  
  
      &lt;div class="form-group row text-left"&gt;
          &lt;label for="example-text-input" class="col-2 col-form-label"&gt;Nama Program: &lt;/label&gt;
          &lt;div class="col-10"&gt;
              &lt;input class="form-control" type="text" name="namaProgram" id="namaProgram"&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group row text-left"&gt;
          &lt;label for="example-text-input" class="col-2 col-form-label"&gt;Lokasi: &lt;/label&gt;
          &lt;div class="col-10"&gt;
              &lt;input class="form-control" type="text" name="lokasi" id="lokasi"&gt;
          &lt;/div&gt;
      &lt;/div&gt;              
  
      &lt;div class="form-group row text-left"&gt;
          &lt;label for="example-text-input" class="col-2 col-form-label"&gt;Dept/Kelab/Anjuran: &lt;/label&gt;
          &lt;div class="col-10"&gt;
              &lt;select class="form-control" name="namaAnjuran" id="namaAnjuran"&gt;
                  &lt;option name="1" value="1"&gt;BK - B. Kewangan&lt;/option&gt;
                  &lt;option name="2" value="1"&gt;BP - B. Pentadbiran&lt;/option&gt;
                  &lt;option name="3" value="1"&gt;BPK - B. Perancangan Hal Ehwal Korporat&lt;/option&gt;
                  &lt;option name="4" value="1"&gt;BPPP - B. Pemb. Penilaian Projek&lt;/option&gt;
                  &lt;option name="5" value="1"&gt;BPPS - B. Pemb. Projek Sosial&lt;/option&gt;
                  &lt;option name="6" value="1"&gt;UAD - Unit Audit Dalaman&lt;/option&gt;
                  &lt;option name="7" value="1"&gt;PWT - Pej. wilayah Temerloh&lt;/option&gt;
                  &lt;option name="8" value="1"&gt;PWB - Pej. Wilayah Barat&lt;/option&gt;
                  &lt;option name="9" value="1"&gt;KOOP - Koperasi LKPP&lt;/option&gt;
                  &lt;option name="10" value="1"&gt;KSKLKPP - KSK LKPP Negeri Pahang&lt;/option&gt;           
                  &lt;option name="11" value="1"&gt;KSKCIP - KSK LKPP Cawangan Ibu Pejabat&lt;/option&gt;
                  &lt;option name="12" value="1"&gt;IBUPEJ - IBU PEJABAT&lt;/option&gt;   
                  &lt;option name="13" value="1"&gt;KESATUAN - KESATUAN SEKERJA&lt;/option&gt;                                    
              &lt;/select&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group row text-left"&gt;
          &lt;label for="exampleTextarea" class="col-2 col-form-label"&gt;Catatan: &lt;/label&gt;
          &lt;div class="col-10"&gt;
              &lt;textarea class="form-control" id="exampleTextarea" rows="3" name="catatan" id="catatan"&gt;&lt;/textarea&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;center&gt;&lt;button type="submit" class="btn btn-info"&gt;Submit&lt;/button&gt;&lt;/center&gt;                     
  
  &lt;/form&gt;
  </code></pre>
  
  <p>when i hit submit, there are no errors, but the data are not insert into the database. </p>