-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlog.php
More file actions
96 lines (85 loc) · 3.3 KB
/
log.php
File metadata and controls
96 lines (85 loc) · 3.3 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<?php
session_start();
$msgs = array();
$warns = array();
$errors = array();
if (isset($_SESSION['msg'])) {
array_push($msgs, $_SESSION['msg']);
unset($_SESSION['msg']);
}
include 'conn.php';
if(isset($_POST['login'])) {
$mobile = $_POST['mobile'];
$password = $_POST['password'];
$password = md5($password);
$query = "SELECT * FROM user WHERE mobile = '$mobile' AND password = '$password'";
$result = mysqli_query($conn , $query);
$resultset = mysqli_fetch_row($result);
if(mysqli_num_rows($result) == 1) {
$_SESSION['ui'] = $resultset[0];
$_SESSION['us'] = $resultset[1];
header('location: index.php');
}
else {
array_push($errors, "invalid mobile or password");
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Login Page</title>
<?php include 'link.php'; ?>
</head>
<body>
<?php include 'nav.php'; ?>
<div style="max-width: 800px;" class="container">
<div>
<h3 style="border-radius: .25rem .25rem 0rem 0rem; margin-top: 80px; margin-bottom: 0px; background-color: #6c757d; text-align: center; color: white;">Online Auction</h3>
</div>
<div style="margin-bottom: 20px; padding-top: 15px; padding-bottom: 15px; box-shadow: 0px 2px 3px 1px #e1e2e3; border-radius: 0rem 0rem .25rem .25rem;" class="container card">
<!-- inlclude msg,warn,err -->
<?php include 'msgs.php'; include 'errors.php'; include 'warnings.php'; ?>
<form id="pform" class="content" action="" method="POST">
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-mobile-phone" style="font-size:24px"></i></span>
</div>
<input type="text" class="form-control" placeholder="Enter Mobile Number" name="mobile" value="">
</div>
<div class="input-group mb-3">
<div class="input-group-prepend">
<span class="input-group-text"><i class="fa fa-lock"></i></span>
<div class="input-group" id="show_hide_password">
<input size="100" class="form-control" name="password" placeholder="Password" type="password">
<span class="input-group-text">
<a href=""><i class="fa fa-eye-slash" aria-hidden="true"></i></a>
</span>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
$("#show_hide_password a").on('click', function(event) {
event.preventDefault();
if($('#show_hide_password input').attr("type") == "text"){
$('#show_hide_password input').attr('type', 'password');
$('#show_hide_password i').addClass( "fa-eye-slash" );
$('#show_hide_password i').removeClass( "fa-eye" );
}else if($('#show_hide_password input').attr("type") == "password"){
$('#show_hide_password input').attr('type', 'text');
$('#show_hide_password i').removeClass( "fa-eye-slash" );
$('#show_hide_password i').addClass( "fa-eye" );
}
});
});
</script>
<div>
<button style="width: 100%;" type="submit" class="btn btn-secondary" name="login" value="Login">Login</button>
</div>
</form>
</div>
</div>
<?php include 'footer.php'; ?>
</body>
</html>