-
Notifications
You must be signed in to change notification settings - Fork 1
/
history.php
37 lines (27 loc) · 1020 Bytes
/
history.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
<!DOCTYPE html>
<?php
error_reporting(E_ERROR | E_PARSE);
include_once('config/config.php');
include_once('config/translate.php');
//echo basename($_SERVER['REQUEST_URI']);
$uri = $_SERVER['REQUEST_URI'];
$protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
$url = $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$query = $_SERVER['QUERY_STRING'];
// Use parse_url() function to parse the URL
// and return an associative array which
// contains its various components
// $url_components = parse_url($url);
// Use parse_str() function to parse the
// string passed via URL
// parse_str($url_components['query'], $params);
// Display result
/* echo ' '.$params['lang']; */
if ( $lang == "ru" ) {
$command = escapeshellcmd('bash ./scripts/history.sh ru');
} else {
$command = escapeshellcmd('bash ./scripts/history.sh');
}
$output = shell_exec($command);
echo "$output";
?>