HomeMediacenter/js/login.js
2020-05-16 20:41:32 +02:00

28 lines
743 B
JavaScript
Executable File

$(document).ready(function() {
$("#myform").submit(function(event) {
event.preventDefault();
// console.log($("#myform").serialize());
checkpasswd($("#myform").serialize());
//
});
});
function checkpasswd(data) {
// console.log(data);
$.post('php/checkpasswd.php', data, function(retdata){
if (retdata.valid == true) {
//successfully logged in
sessionStorage.LAST_ACTIVITY = Math.round(new Date().getTime() / 1000);
document.cookie = "LAST_ACTIVITY="+Math.round(new Date().getTime() / 1000);
window.location ="movies.php";
return true;
}else {
$(".mypassalert").show();
setTimeout(function () {
$(".mypassalert").hide();
}, 2000);
}
},'json');
}