hi,
On a test page i try to insert some values thru post method but the values which i send is not replaced in the url which i specify. I get the code found in the page and not the updated one.
My Code
after creating the xmlhttp object
temp ="";
function ajxReq(){
url ="http://192.168.1.41/ajaxsend/login.php?unameTxt=" +document.getElementById('loginName').value+"&pwdT xt=" +document.getElementById('loginPassword').value;
xmlhttp.open("POST",url,true)
xmlhttp.onreadystatechange = loadPage;
xmlhttp.send(null)
}
function loadPage(){
// on status=200
document.getElementById("respdiv").innerHTML = xmlHttp.responseTEXT;
alert("The Div \t"+document.getElementById("respdiv").innerHTML );
// this gives the raw file not the updated one
}
function sendParam(){
temp = '"name="+document.getElementById(\'loginName\').va lue+"password="
+document.getElementById(\'loginPassword\').value' ;
ajxReq();
}
</script>
</head>
<table border="0" cellspacing="0" cellpadding="0" width="300">
<tr>
<td>User Name</td>
<td><input type="text" name="unameTxt" id="loginName" /></td>
</tr>
<tr>
<td>Password</td>
<td><input type="password" name="pwdTxt" id="loginPassword" /></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="button" value="Login" onclick="sendParam();"/></td>
</tr>
</table>
<div id="respdiv" style="border:1px dashed orange"></div>
</html>
i tried thru xmlHttp.send(temp) ............. giving the static url with parameters...
Nothig is working
php file
******
<?php
$uname = $_POST["unameTxt"];
$pwd = $_POST["pwdTxt"];
echo "User Name :".$uname."<br>Password :".$pwd;
?>
Looking for a reply to proceed further.
I have another doubt too. IF it is working fine with response text i dont have an idea of structure of the xml doc formed .... Looking for an comment on this too.