-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBiometric_match.php
193 lines (150 loc) · 5.97 KB
/
Biometric_match.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
<script>
history.pushState(null, document.title, location.href);
window.addEventListener('popstate', function (event)
{
history.pushState(null, document.title, location.href);
});
</script>
<?php
$conn = mysqli_connect("","","","");
session_start();
if(!isset($_SESSION['username']))
{
header("Location: login.php");
}
if(!isset($_SESSION['submit']))
{
$_SESSION['securityquestion1'] = '';
$_SESSION['securityanswer1'] = '';
$_SESSION['securityquestion2'] = '';
$_SESSION['securityanswer2'] = '';
}
$username01 = $_SESSION['username'];
// echo "<script type='text/javascript'>alert('Welcome $username01')</script>";
mysqli_query($conn, $sql1);
$query01 = "SELECT * FROM register WHERE email_id='$username01'";
$result01 = mysqli_query($conn, $query01);
if ($result01->num_rows >= 0)
{
while($row01 = $result01->fetch_assoc())
{
$fp = $row01["fingerprint"];
}
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>user-login</title>
<link rel="stylesheet" href="../css/register.css">
<link rel="stylesheet" href="../css/bootstrap.min.css">
<link rel="stylesheet" href="../css/AdminLTE.min.css">
<link rel="apple-touch-icon" sizes="57x57" href="../favicons/apple-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="../favicons/apple-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="../favicons/apple-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="../favicons/apple-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="../favicons/apple-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="../favicons/apple-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="../favicons/apple-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="../favicons/apple-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="../favicons/apple-icon-180x180.png">
<link rel="icon" type="image/png" sizes="192x192" href="../favicons/android-icon-192x192.png">
<link rel="icon" type="image/png" sizes="32x32" href="../favicons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/manifest.json">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/ms-icon-144x144.png">
<meta name="theme-color" content="#ffffff">
<script src="jquery-1.8.2.js"></script>
<script src="mfs100-9.0.2.6.js"></script>
<script language="javascript" type="text/javascript">
var quality = 60; //(1 to 100) (recommanded minimum 55)
var timeout = 10; // seconds (minimum=10(recommanded), maximum=60, unlimited=0 )
var flag = 0;
// Function used to match fingerprint using jason object
function Match() {
try {
//fingerprint stored as isotemplate
var isotemplate = <?php echo json_encode($fp); ?>;
var res = MatchFinger(quality, timeout, isotemplate);
if (res.httpStaus) {
if (res.data.Status) {
alert("Finger matched");
//variable flag used for authentication
flag=1;
}
else {
if (res.data.ErrorCode != "0") {
alert(res.data.ErrorDescription);
}
else {
alert("Finger not matched");
}
}
}
else {
alert(res.err);
}
}
catch (e) {
alert(e);
}
return false;
}
//function to redirect to next page upon fingerprint matching
function redirect(){
if(flag){
window.location.assign("url");
}
else{
alert("Scan Your Finger");
}
return false;
}
</script>
</head>
<body class="mainbody">
<div class="header">
<img class="left" src="../favicons/apple-icon-60x60.png" height="40" width="40">
</div>
<div class="register_panel">
<div class="panel panel-primary">
<div class="panel-heading font"> </div>
<div class="panel-body">
<form method = "post" name="myForm" action="#">
<div class="hide">
<table>
<tr>
<td>
Base64Encoded ISO Image
</td>
<td>
<textarea id="txtIsoTemplate" style="width: 100%; height:50px;" class="form-control"> </textarea>
</td>
</tr>
</table>
</div>
<div class="finger_print padd fingerpadd" style="border:solid">
<div>
<figure>
<img src="https://www.larsonjewelers.com/Images/larson-jewelers-fingerprint-engraving-ring.png" alt="finger_print" width="100" height="100">
</figure>
</div>
<div>
<button type="input" onclick="return Match()" class="btn btn-default padd" >start scanning</button>
</div>
</div>
<div>
<button type="submit" onclick="return redirect()" class="btn btn-primary btn-lg padd submit_buttom_padding btn-block" value="submit" name="submit">Submit</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
</body>
</html>