-
Notifications
You must be signed in to change notification settings - Fork 0
/
uservalidate.php
62 lines (52 loc) · 1.24 KB
/
uservalidate.php
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
require_once("dummy.php");
session_start();
$conn = mysqli_connect('localhost','root','','admindb');
if (isset($_POST['login'])) {
$email = $_POST['email'];
$password = $_POST['password'];
}
$query="SELECT * FROM USERSRC WHERE EMAIL='$email'";
$data=mysqli_query($conn,$query);
$num=mysqli_num_rows($data);
$result=mysqli_fetch_assoc($data);
if($num===0){
echo "<script>
swal({
title: 'Invalid Credentials!',
text: 'Please check and try again',
type: 'error'
},
function(){
window.location.href = 'userlogin.php';
});
</script>";
}elseif ( (md5($password))!== $result['password']) {
echo "<script>
swal({
title: 'Password invalid!',
text: 'Please check and try again',
type: 'error'
},
function(){
window.location.href = 'userlogin.php';
});
</script>";
}
else{
$_SESSION['email']=$result['email'];
// header("Location: recommendations.php");
echo "<script>
swal({
title: 'Login Successful!',
text: 'Welcome Admin!!',
type: 'success'
},
function(){
window.location.href = 'movetorecom.php';
});
</script>";
}
//idhi asala save cheyle ipdu chesi check karo
?>
<!-- plans.html -->