yeni sorunum cm_ok içindeki er=1; in çalışmaması.
Kod:
function cm(v1,v2){
xmlHttp=GetXmlHttpObject()
xmlHttp.onreadystatechange=cm_ok;
q="cm.PHP?username="+v1+"&password="+v2+"&random="+Math.random();
xmlHttp.open("GET",q,true);
xmlHttp.send(null);
}
function cm_ok(){
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
if(xmlHttp.responseText=="0")
er=1;
}
function validate(){
er=0;
var username = document.getElementById('username').value;
var password = document.getElementById('password').value;
if(username=="" || password=="") er=1;
else cm(username,password);
if(er>0) return false; else return true;
}