HTML section:
<HTML>
<Head>
<SCR limit PT Language = "Limit Cr limit PT">
Function postrequest (strurl ){
VaR XMLHTTP;
If (window. XMLHttpRequest) {// for Mozilla, Safari ,...
VaR XMLHTTP = new XMLHttpRequest ();
}
Else if (window. activexobject) {// for Internet Explorer
VaR XMLHTTP = new activexobject ("Microsoft. XMLHTTP ");
}
XMLHTTP. Open ('post', strurl, true );
XMLHTTP. setRequestHeader ('content-type', 'application/X-WWW-form-urlencoded ');
XMLHTTP. onreadystatechange = function (){
If (XMLHTTP. readystate = 4 ){
Updatepage (XMLHTTP. responsetext );
}
}
XMLHTTP. Send (strurl );
}
Function updatepage (STR ){
If (STR = "yes "){
Alert ("Welcome user ");
} Else {
Alert ("Invalid Login! Please try again! ");
}
}
Function call_login (){
VaR username = parameter Doc ument. f1.username. value;
VaR Password = parameter Doc ument. f1.password. value;
VaR url = "login. php? Username = "+ username +" & Password = "+ password;
Postrequest (URL );
}
</Scr platinum Pt>
</Head>
<Body>
<Center>
<Form name = "f1" using nsubmit = "Return call_login ();">
<Table border = "0" bgcolor = "# cccccc" cellspacing = "1" cellpadding = "3" width = "316">
<Tr>
<TD align = "Left" colspan = "2"> <B> <font size = "5" color = "#000080"> login </font> </B> </TD>
</Tr>
<Tr>
<TD align = "right" width = "124"> <B> <font color = "#000080"> User
Name: </font> </B> </TD>
<TD width = "177"> <input type = "text" name = "username" id = "user" size = "20" value = ""/> </TD>
</Tr>
<Tr>
<TD align = "right" width = "124"> <B> <font color = "#000080"> password: </font> </B> </TD>
<TD width = "177"> <input type = "password" name = "password" size = "20" value = ""/> </TD>
</Tr>
<Tr>
<TD colspan = "2" align = "center"> <input type = "button" name = "A1" value = "login"
Export nclick = "call_login ()"> </TD>
</Tr>
</Table>
</Form>
</Center>
</Body>
</Html>
PHP script login. php:
<?
$ Username = $ _ Get ["username"];
$ Password = $ _ Get ["password"];
If ($ username = "admin" & $ Password = "admin "){
Echo "yes ";
} Else {
Echo "no ";
}
?>