hi i am new to web development and i am using js/ajax code to load o/p of php file in <div> tag. Now i am using a login.php file and i want that if login credentials are correct then further page should be open in current window else login fail message should be displayed below the username and password text box. following is the code i am using -
how can i modify the above code to do above written task?
Code:
function updateLink(id,pwd){
var oRequest;
try {
oRequest=new XMLHttpRequest();
} catch (e) {
try {
oRequest=new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
oRequest=new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
oRequest.onreadystatechange=function() {
if(oRequest.readyState==4)
{
var div = window.parent.document.getElementById('result');
div.innerHTML = oRequest.responseText;
}
}
var url = "updateLinks.php";
url = url+"?id="+id;
url = url+"&pass="+pwd
oRequest.open("GET",url,true);
oRequest.send(null);
}
Comment