-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathheader.php
More file actions
35 lines (28 loc) · 857 Bytes
/
Copy pathheader.php
File metadata and controls
35 lines (28 loc) · 857 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
<?php
$dev = false;
if ($dev === true) {
// ini_set('display_errors', 1);
// ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
ini_set('display_errors', 1);
$filename = "./.env_developer";
} else {
$filename = "./.env";
}
$setting = parse_ini_file($filename);
$servernamesql = $setting["servernamesql"] ?? null;
$usernamesql = $setting["usernamesql"] ?? null;
$passwordsql = $setting["passwordsql"] ?? null;
$databasesql = $setting["databasesql"] ?? null;
session_start();
if (!isset($_SESSION['themevalue'])) {
$theme = 'light';
} else if ($_SESSION['themevalue'] == 'dark') {
$theme = 'dark';
} else if ($_SESSION['themevalue'] == 'light') {
$theme = 'light';
}
$date = date('Y-m-d H:i:s');
setcookie("datecookie", $date, time() + 3600);
setcookie("theme", $theme, time() + 3600 * 24 * 365 * 10);
?>