function loginCheck() { var name = document.frm1.username.value; var pass = document.frm1.password.value; if( name == "zghlx" && pass == "123" ) { var login = true; var now = new Date(); now.setDate( now.getDate() + 30); setCookie("login",login,now); window.location.href = "index.html"; } }
function userlogin() { var login = getCookie("login"); if ( login != null && login != "" ) { alert("Welcome..."); window.location.href = "index.html"; } }