-
Notifications
You must be signed in to change notification settings - Fork 0
/
global.php
39 lines (34 loc) · 923 Bytes
/
global.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
<?
ini_set('session.cookie_lifetime', 60 * 60 * 24 * 100);
ini_set('session.gc_maxlifetime', 60 * 60 * 24 * 100);
ini_set('session.save_path', '/tmp');
session_start();
//maybe you want to precise the save path as well
include_once("database.php");
//maybe you want to precise the save path as well
//cheaking
if (isset($_SESSION['email'])&&isset($_SESSION['password']))
{
$session_password = $_SESSION['password'];
$session_email = $_SESSION['email'];
$query = "SELECT * FROM lib_users WHERE email='$session_email' AND password='$session_password'";
}
$result = $con->query($query);
if ($result->num_rows > 0){
while($row = $result->fetch_assoc())
{
$logged=1;
$session_role = $row['role'];
$session_name = $row['name'];
/**
?>
<script>console.log("$session_role<?echo $session_role ?>")</script>
<?
**/
}
}
else
{
$logged=0;
}
?>