-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththemeLoad.php
More file actions
32 lines (26 loc) · 862 Bytes
/
Copy paththemeLoad.php
File metadata and controls
32 lines (26 loc) · 862 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
<?php
session_start();
require('db.php');
if (isset($_SESSION['username'])){
$username = $_SESSION['username'];
$username = stripslashes($username);
$dataOut = array();
$dataOut['theme'] = "off";
$query="SELECT * FROM user_settings WHERE username='$username'";
$result = mysqli_query($conn, $query) or die(mysqli_error($conn));
$rows = mysqli_num_rows($result);
if($rows>=1){
while($row = mysqli_fetch_array($result)) {
$dataOut['theme'] = $row[2];
$dataOut['success'] = true;
$dataOut['last_project'] = $row[3];
$dataOut['pre_last_project'] = $row[4];
}
}else{
$dataOut['success'] = false;
}
echo json_encode($dataOut);
}else{
echo "not allowed to do that";
}
?>