-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.php
More file actions
45 lines (37 loc) · 794 Bytes
/
common.php
File metadata and controls
45 lines (37 loc) · 794 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
36
37
38
39
40
41
42
43
44
45
<?php
$address = 'https://learnqntm.com/';
session_start();
header('Cache-control: private'); // IE 6 FIX
if(isset($_GET['lang'])) {
$lang = $_GET['lang'];
// register the session and set the cookie
$_SESSION['lang'] = $lang;
//setcookie('lang', $lang, time() + (3600 * 24 * 30));
}
else if(isSet($_SESSION['lang'])) {
$lang = $_SESSION['lang'];
}
/* else if(isSet($_COOKIE['lang'])) {
$lang = $_COOKIE['lang'];
} */
else {
$lang = 'en';
}
switch ($lang) {
case 'en':
$lang_file = 'lang.en.php';
break;
case 'sk':
$lang_file = 'lang.sk.php';
break;
/*
case 'cz':
$lang_file = 'lang.cz.php';
break;
*/
default:
$lang_file = 'lang.en.php';
}
include_once 'lang/'.$lang_file;
//include_once $_SERVER['DOCUMENT_ROOT'].'lang/'.$lang_file;
?>