-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsession.php
More file actions
47 lines (41 loc) · 1.3 KB
/
session.php
File metadata and controls
47 lines (41 loc) · 1.3 KB
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
46
47
<?php
/*PURPOSE:
This file retrieves all user information once its proven they
have successfully logged in.
*/
error_reporting(-1);
include('connection.php');
@session_start(); // Starting Session
// Storing Session
$user_check=$_SESSION['login_user'];
$result = $dbc->query("SELECT * from users where usernames='$user_check'");
$row = $result->fetch_assoc();
$login_id=$row['id'];
$login_status = $row['online_status'];
$login_session =$row['first_name'];
$login_lname=$row['last_name'];
$login_uname=$row['usernames'];
$login_session_email=$row['email'];
$course=$row['course'];
$section=$row['section'];
//added for play game live
$_SESSION['course'] = $course;
$_SESSION['section'] = $section;
$score = $row['score'];
$busy = $row['busy'];
$time= $row['time'];
$sql = "SELECT id FROM games WHERE (player1='$login_id' OR player2='$login_id') AND (status=6)";
$query = $dbc->query($sql);
$gplayed = $query->num_rows;
//end additions
$_SESSION['login_id'] = $login_id;
$result2 = $dbc->query("SELECT * from teamcode where users_id='$login_id'");
$row2 = $result2->fetch_assoc();
$login_teamcolor = $row2['user_group'];
$login_teamcolor_num = $row2['users_id'];
if(!isset($login_session))
{
mysqli_close($dbc);
header('Location: index.php'); // Redirecting To Home Page
}
?>