-
Notifications
You must be signed in to change notification settings - Fork 1
/
w.php
67 lines (49 loc) · 1.81 KB
/
w.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<?php
error_reporting(E_ERROR | E_PARSE);
include_once('config/config.php');
include_once('config/translate.php');
$actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]$_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 ($_SERVER["REQUEST_METHOD"] == "GET") {
// Перебираем все GET-параметры и выводим их
foreach ($_GET as $key => $value) {
echo $key . ' => ' . $value . '<br>';
}
} */
if ( preg_match('/\/ru/', $actual_link)) {
$outputlang = "-oru";
} else {
$outputlang = "";
}
if ($_SERVER["REQUEST_METHOD"] == "GET") {
$p = trim($_GET["p"]);
}
$s = isset($_GET['s']) ? htmlspecialchars($_GET['s']) : '';
if ($_SERVER["REQUEST_METHOD"] == "GET") {
if(isset($_GET['d'])) {
$selectedParams = $_GET['d'];
$searchIn = "-src " . $selectedParams;
} else {
$searchIn = "";
}
}
//$s ="lobh";
$stringForOpen = isset($s) ? strtolower(trim(str_replace("`", "", $s))) : '';
$command = escapeshellcmd("bash ./new/words.sh $p $outputlang $searchIn $stringForOpen");
//$command = escapeshellcmd("bash ./db/fdg3.5.sh $stringForOpen");
$output = shell_exec($command);
echo "$output";
?>