heres the code:
Code: Select all
<html>
<head>
function getHTTPObject() {
var xmlhttp;
/*@cc_on
@if (@_jscript_version >= 5)
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}
@else
xmlhttp = false;
@end @*/
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
}
}
return xmlhttp;
}
var http = getHTTPObject();
function get_hashed_password(){
var username = document.getElementById("username").value;
http.onreadystatechange = handlehashedpassword();
http.open("POST", "get_hashed_password.php", true);
http.send('username='+escape(username));
}
function handlehashedpassword(){
if (http.readyState == 4){
var hashed_password = http.responseText;
document.getElementById('results').innerHTML = hashed_password;
}
}
</head>
<body>
<div>
<form>
Username:
<br>
<input id="username" type="text" name="username" maxlength="12" size="12" onblur="get_hashed_password();">
<br>
Password:
<br>
<input id="password" type="password" name="password" maxlength="12" size="12"></center></td>
<br>
Remember me<input type="checkbox" checked name="remember">
<br>
<input type="submit" value="Login" onclick="login();">
</form>
<form action="register.html" method="LINK">
<input type="submit" value="Register">
</form>
</div>
<div id="results">results here</div>
</body>
</html>this is just a test and isnt actually meant to login its just supposed to say the username below the form when you type it in..
EDIT: oh yea the functions are supposed to be in javascript tags, you can test what happens here, http://freescripts.exofire.net/ajax/login.html