-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlg.js
33 lines (29 loc) · 1.05 KB
/
lg.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$(function(){
//alert("Hi 1");
var frm = $('#lg');
frm.submit(function (e) {
e.preventDefault();
var uname = document.getElementById('username').value;
var pass = document.getElementById('password').value;
var url="" ;
$.ajax({
url: 'lg.php',
method: 'POST',
dataType: 'JSON',
data: {'pass': pass , 'uname':uname},
success: function (data) {
document.getElementById("resp").innerHTML = data.reply;
if(data.reply == "Login success"){
window.location.href = "admin.php?uname="+uname;
}
else{
console.log("LOL no");
}
},
error: function (data) {
console.log('An error occurred.');
console.log(data);
},
});
});
})