-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
35 lines (25 loc) · 986 Bytes
/
Copy pathindex.php
File metadata and controls
35 lines (25 loc) · 986 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
<?php
include "includes/config.php";
include "includes/header.php"; // HTML Header
// checking for minimum PHP version
if (version_compare(PHP_VERSION, '5.3.7', '<')) {
exit("Sorry, Simple PHP Login does not run on a PHP version smaller than 5.3.7 !");
} else if (version_compare(PHP_VERSION, '5.5.0', '<')) {
// (this library adds the PHP 5.5 password hashing functions to older versions of PHP)
require_once("includes/password_compatibility_library.php");
}
// include the configs / constants for the database connection
require_once("includes/db.php");
// load the login class
require_once("includes/login.php");
// create a login object. when this object is created, it will do all login/logout stuff automatically
$login = new Login();
// if we are logged in here:
if ($login->isUserLoggedIn() == true) {
include("views/logged_in.php");
} else {
// Not logged in
include("views/not_logged_in.php");
}
include "includes/footer.php"; // HTML Footer
?>