-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcheckEmail.php
More file actions
42 lines (32 loc) · 908 Bytes
/
checkEmail.php
File metadata and controls
42 lines (32 loc) · 908 Bytes
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
<?php
include "partials/_sessionHead.php";
$match = false;
if (isset($_GET['w']) && $_GET['w'] == 1) {
$email = $_POST['email'];
$sql = "SELECT `studentEmail` from `users`";
$result = mysqli_query($con, $sql);
if ($result) {
while ($row = mysqli_fetch_assoc($result)) {
if (strcmp($email, $row['studentEmail']) == 0) {
$match = true;
break;
}
}
}
if ($match == false) {
echo "Invalid Email";
}
} else {
$password = $_POST['password'];
$email = $_GET['email'];
$sql = "SELECT `studentPassword` from `users` WHERE `studentEmail`='$email'";
$result = mysqli_query($con, $sql);
$row = mysqli_fetch_assoc($result);
if (password_verify($password, $row['studentPassword'])) {
$match = true;
}
if ($match == false) {
echo "Wrong Password";
}
}
?>