-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth2.php
More file actions
26 lines (25 loc) · 818 Bytes
/
auth2.php
File metadata and controls
26 lines (25 loc) · 818 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
<?php
require_once 'connect_db.php';
if(isset($_POST['sub'])) {
if(!empty($_POST['login_auth']) &&
!empty($_POST['password_auth'])) {
$login = $_POST['login_auth'];
$password = $_POST['password_auth'];
$mysqli_auth = connect_db();
$result = $mysqli_auth->query("SELECT
login,
password
FROM users_auth"
);
$rows = $result->fetch_assoc();
do {
if(($login == $rows['login']) && ($password == $rows['password'])) {
$_SESSION["auth"] = "ok";
$_SESSION["user"] = $login;
header('Location: users.php');
exit;
}
} while($rows = $result->fetch_assoc());
}
}
?>