function login() { var myAjaxPostrequest=new GetXmlHttpObject(); var myid = document.forms["frmLogin"].txtusername.value; var pass = document.forms["frmLogin"].txtpassword.value; var emel = document.forms["frmLogin"].txtEmail.value; var repassword =document.forms["frmLogin"].txtreKataLaluan.value; var parameters = "myid="+myid+"&pass="+pass+"&emel="+emel+"&repassword="+repassword; myAjaxPostrequest.open("POST", "simpan_daftar_stu.php", true); myAjaxPostrequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); myAjaxPostrequest.send(parameters); myAjaxPostrequest.onreadystatechange=function() { if(myAjaxPostrequest.readyState==4) { if(myAjaxPostrequest.status==200){ var flagReturn = myAjaxPostrequest.responseText; //alert (flagReturn); if(flagReturn == "0"){ alert("Thank You, You had successful register."); document.forms["frmLogin"].action="login.php"; document.forms["frmLogin"].submit(); }else{ //document.getElementById('error').innerHTML = flagReturn; alert(flagReturn); } } } } }

 

Register Form

 

© 2019 by Akademi Pengajian Bahasa UiTM Cawangan Pulau Pinang. | Proudly created English Exit Test

Best viewed using Google Chrome