you can use this code for login
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Javascript User Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<script language="javascript" type="text/javascript">
//
// Javascript User Login 3.0
// Some Rights Reserved
//
http://webdeveloper.50webs.com
//
var userFolder = ""; // Folder where userfile (e.g. PizzaMan127~Cheese.htm) is located (e.g "users/")
var HTMLextention = ".htm"; // Extension of the user-file (usually .htm or .html)
var inProgressMSG = "Attempting login..."; // Message displayed during a login
var userFailMSG = "Invalid username or password"; // Message displayed after failed attempt
// Do not edit
function login(){
var username= document.getElementById('username').value; // location of username
var password= document.getElementById('password').value; // location of password
username= username.toLowerCase(); // convert to lowercase for case-sensitive servers
password= password.toLowerCase(); // convert to lowercase for case-sensitive servers
var fullURL= "";
fullURL= userFolder + username + "~" + password + HTMLextention; // compiled filename the loads user-file
setTimeout("failEvents();", 15000); // after 15 seconds display error message
document.getElementById('errorDisplay').value = inProgressMSG; // show in-progress message
showMSG();
setTimeout("showMSG();", 5000); // hide in-progress message after 5 seconds
verifWin.document.open();
verifWin.document.location.rel="nofollow" href = fullURL; // trys to find user-file
verifWin.document.close();
}
function passEvents(data){ // Events that occur for valid login
var URL = data;
location.rel="nofollow" href=URL;
}
function failEvents(){ // Events that occur for invalid login
document.getElementById('errorDisplay').value = userFailMSG;
showMSG();
}
function showMSG() { // Controls the opening/closing of messages
if ((document.getElementById("isShown_errorConsole").value)=="N") {
document.getElementById("errorConsole").style.display='';
document.getElementById("isShown_errorConsole").value="Y";}
else if ((document.getElementById("isShown_errorConsole").value)=="Y") {
document.getElementById("errorConsole").style.display='none';
document.getElementById("isShown_errorConsole").value="N";}
}
</script>
<table width="250" border="0" cellpadding="1" cellspacing="5" bgcolor="#9FB8FF">
<tr>
<td bgcolor="#9FB8FF" align="center"><b><font size="4" color="#FFFFFF">Authorization Required</font></b></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><form action="javascript:login();" method="get" name="LoginScript" id="LoginScript">
<table border="0" cellspacing="10" cellpadding="0" width="100%">
<tr>
<td> Username</td>
<td align="right"> <input name="username" id="username" type="text" style="border:1px solid #828177;" value="" /></td>
</tr>
<tr>
<td> Password</td>
<td align="right"> <input name="password" id="password" type="password" style="border:1px solid #828177;" value="" /></td>
</tr>
<tr>
<td><iframe name="verifWin" src="" width="1" height="1" frameborder="0" border="0"></iframe></td>
<td align="right"><input name="submit" type="submit" style="border:1px solid #9FB8FF;color:#FFFFFF;background-color:#9FB8FF;" value="Login" /></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><input type="hidden" id="isShown_errorConsole" value="Y" />
<span id="errorConsole" style="display:;">
<input type="button" id="errorDisplay" style="width:100%;background-color:#FFFFFF;border:0px;" value="Error: Please enable Javascript" />
</span><script language="javascript" type="text/javascript">showMSG();</script></td>
</tr>
</table>
</body>
</html>