-
Notifications
You must be signed in to change notification settings - Fork 1
/
login_verify.php
executable file
·45 lines (39 loc) · 1.61 KB
/
login_verify.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
<?php require_once("includes/session.php");?>
<?php require_once("includes/db_connection.php");?>
<?php require_once("includes/functions.php");?>
<?php
if (logged_in()) {
redirect_to ("public/Inside/buzz.php");
}
?>
<?php
$username = $_POST["username"];
$password = $_POST["password"];
$query_email = "SELECT * FROM users WHERE username = '{$username}'";
$result_email = mysqli_query($conn, $query_email);
while ($row=mysqli_fetch_assoc($result_email)) {
$db_confirmed = $row['confirmed'];
}
$found_user = attempt_login($username, $password);
if ($found_user) {
if ($db_confirmed==1) {
/*$query_get="SELECT * FROM live WHERE id='1'";
$result_get= mysqli_query($conn, $query_get);
while ($live_users=mysqli_fetch_assoc($result_get))
{
$live = $live_users['live_users'];
}
//$live_users=mysqli_fetch_assoc($result_email);
$live=$live+1;
$query_update= "UPDATE live SET live_users='{$live}' WHERE id= '1'";
$result = mysqli_query($conn, $query_update);*/
$_SESSION["user_id"] = $found_user["id"];
$_SESSION["username"] = $found_user["username"];
echo "loggedin";
} else {
echo "Account not confirmed";
}
} else {
echo "Invalid Username or Password. Please check if CAPS is not pressed";
}
?>