-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
79 lines (74 loc) · 2.89 KB
/
login.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
if(isset($_GET['id']) && $_GET['id']>0){
echo "<script>
alert('Congractulation ! Your Email Id sussesfuly Verifed Please Login Now');
</script>";
}
include 'includes/navigation_bar.php';
$username = '';
$password ='';
$msg = '';
$type = '';
$page='';
if(isset($_GET['type']) && $_GET['type']!='' && isset($_GET['page']) && $_GET['page']!=''){
$type = mysqli_escape_string($con,$_GET['type']);
$page = mysqli_escape_string($con,$_GET['page']);
if($type=='msg'){
$msg = "<script>
alert(`Your Are Not Login Please Login Now For Access $page`);
</script>";
}
}
if(isset($_POST['login'])){
$username = mysqli_escape_string($con,$_POST['username']);
$password = mysqli_escape_string($con,$_POST['password']);
$password = md5($password);
$check = mysqli_query($con,"select * from users where username = ' $username' AND password='$password' AND email_verification='1' AND status='1'");
$res = mysqli_fetch_assoc($check);
if(mysqli_num_rows($check)){
$_SESSION['USER_LOGIN'] = 'yes';
$_SESSION['USER_NAME'] = $res['name'];
$_SESSION['USER_ID'] = $res['id'];
header('Location:index');
}else{
$msg = "<div class='alert' role='alert'>
Please Enter Correct Username And Password Or Verify Your Email Id</a>
</div>";
}
}
?>
<!-- Login Page -->
<div class="container login_page">
<div class="row heading">
<div class="col-xl-12">
<h2>Login Now</h2>
<p>LOGIN YOUR SELF</p>
</div>
</div>
<?php echo $msg; ?>
<div class="row signup-form-body">
<div class="col-xl-6">
<!-- <div class="social_register">
<button class="btn"><span><i class="fa fa-google" aria-hidden="true"></i></span> Login With Google </button>
<p>OR</p>
</div> -->
<form method="post" action="">
<div class="form-input">
<input type="text" name="username" placeholder="Enter Your Username" required>
</div>
<div class="form-input">
<input type="password" name="password" placeholder="Enter Your Password" required>
</div>
<p class="m-0">Forgot Password?<a href="<?php echo WEBSITE_PATH; ?>forgot_password"> Here</a>.</p>
<div class="form-input d-flex align-items-center flex-wrap">
<button type="submit" name="login">Login Now</button>
<p>You are Not Signup,Please <a href="<?php echo WEBSITE_PATH; ?>registration">signup Here</a>.</p>
</div>
</form>
</div>
</div>
</div>
<!--X- Login Page -X-->
<?php
include 'includes/footer.php';
?>