-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
37 lines (26 loc) · 878 Bytes
/
index.php
File metadata and controls
37 lines (26 loc) · 878 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
<?php
// This page checks the dbc, posted email, posted password.
// This page sets the cookies.
if (isset($_POST['submitted'])) {
require_once ('../musiclibrary_connect.php');
require_once ('includes/login_functions.inc.php');
list ($check, $data) = check_login($dbc, $_POST['email'], $_POST['pass']);
if ($check) { // OK!
// Set the session data:.
session_start();
$_SESSION['user_id'] = $data['user_id'];
$_SESSION['first_name'] = $data['first_name'];
$_SESSION['last_name'] = $data['last_name'];
// Store the HTTP_USER_AGENT:
$_SESSION['agent'] = md5($_SERVER['HTTP_USER_AGENT']);
// Redirect:
$url = absolute_url ('musicians.php');
header("Location: $url");
exit();
} else { // Unsuccessful!
$errors = $data;
}
mysqli_close($dbc);
} // End of the main submit conditional.
include ('includes/login_page.inc.php');
?>