title: submitting data into mysql database using PHP as the process engine using javascript xmlhttprequest
body: <p>i am facing the problem here.. i wanna update the data from my multiple front-end forms which are contained student profile, parents profile, academic information and so on.. if i update these forms just using PHP without JavaScript, all my data in my tables can update properly but when i attached my JavaScript framework file, my data triggered the error's alert and its unable to update the mysql table. I only use native JavaScript and XMLHttpRequest (i believe it is one of AJAX syntax).. below is my syntax of JS.. thanks for help.. for this moment, i don't wanna use jQuery for this moment because i wanna deeply understand the JavaScript's flow first. thanks for help..</p>
  
  <pre><code>function checkStatus(){
      var icNumber = document.getElementById("studentICNumber").value;
      var studentName = document.getElementById("studentFullname").value;
  
      var no = document.getElementById("no");
      var yes = document.getElementById("yes");
  
      var updateDB = function(noic){
      var xmlhttp;
      //var noic;
  
      if(window.XMLHttpRequest){
          xmlhttp = new XMLHttpRequest();
      }
      else{
          xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
      }
  
      xmlhttp.onreadystatechange = function(){
          if(xmlhttp.readyState === 4 &amp;&amp; xmlhttp.status === 200){
              alert(xmlhttp.responseText);
          }
      }
  
      xmlhttp.open("POST", "studentStatus.php?noic="+noic, true);
      xmlhttp.send();
  };
  
  if(no.checked === true){
      alert(studentName + " is not eligible to enter this college");
      window.location="updateStudentStatus.php";
  }
  else{
      if(updateDB(icNumber)){
          alert("Done Updating The Information For " + studentName);
          //window.location.reload();
      }
      else{
          alert("There is an error.");
          //document.getElementById("messageAlert_1").innerHTML = "error";
      }
    }
  } 
  </code></pre>