-
Notifications
You must be signed in to change notification settings - Fork 2
/
portable.php
43 lines (43 loc) · 940 Bytes
/
portable.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
40
41
42
43
<?php
$langs_arr=['rus'];
$default_lang='rus';
$lang=$default_lang;
if(isset($_GET['lang'])){
if(in_array($_GET['lang'],$langs_arr)){
$lang=$_GET['lang'];
}
}
else
if(isset($_COOKIE['lang'])){
if(in_array($_COOKIE['lang'],$langs_arr)){
$lang=$_COOKIE['lang'];
}
}
if(!in_array($lang,$langs_arr)){
$lang=$default_lang;
}
$filename='myvizplus-'.$lang.'.html';
$output_filename='myvizplus-'.$lang.'.html';
if(file_exists($filename)){
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".$output_filename);
header("Content-Type: text/html");
header("Content-Transfer-Encoding: binary");
readfile($filename);
}
else{
header('HTTP/1.1 404 Not Found');
print '<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<TITLE>404 Not Found</TITLE>
</head>
<body>
<h1>Not Found</h1>
The requested URL was not found on this server.<P>
</body>
</html>';
}
exit;