如果不用加密的话,用js就可以,其实就是一个记住用户名密码的功能
账号:
密码:
记住密码:
登录
var user = document.getElementsByTagName("input")[0],
pass = document.getElementsByTagName("input")[1],
check = document.getElementsByTagName("input")[2],
loUser = localStorage.getItem("user") || "";
loPass = localStorage.getItem("pass") || "";
user.value = loUser;
pass.value = loPass;
if(loUser !== "" && loPass !== ""){
check.setAttribute("checked","");
}
function fn(){
if(check.checked){
localStorage.setItem("user",user.value);
localStorage.setItem("pass",pass.value);
}else{
localStorage.setItem("user","");
localStorage.setItem("pass","");
}
}