-
Notifications
You must be signed in to change notification settings - Fork 1
/
s.php
83 lines (60 loc) · 2.32 KB
/
s.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<!DOCTYPE html>
<?php
error_reporting(E_ERROR | E_PARSE);
include_once('config/config.php');
include_once('config/translate.php');
//echo basename($_SERVER['REQUEST_URI']);
$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 ($_SERVER["REQUEST_METHOD"] == "GET") {
$s = trim($_GET["s"]);
}
if ($_SERVER["REQUEST_METHOD"] == "GET") {
$extra = trim($_GET["extra"]);
}
if ($_SERVER["REQUEST_METHOD"] == "GET") {
$p = trim($_GET["p"]);
}
// Проверка условий
if (preg_match('/wordRep/', $p) || preg_match('/wordRep/', $extra)) {
// Действие при выполнении условия
$stringForWord = urlencode($stringForWord); // Предполагая, что $string определено где-то в вашем коде
echo "<script>
window.location.href='/w.php?s=$stringForWord';
</script>";
exit();
}
if ($_SERVER["REQUEST_METHOD"] == "GET") {
if(isset($_GET['d'])) {
$selectedParams = $_GET['d'];
$searchIn = "-src " . $selectedParams;
} else {
$searchIn = "";
}
}
$string = str_replace("`", "", $s);
$stringForOpen = strtolower(trim($string));
$command = escapeshellcmd("bash ./fdgnew.sh $p $extra $searchIn $stringForOpen");
//$command = escapeshellcmd("bash ./db/fdg3.5.sh $stringForOpen");
$output = shell_exec($command);
// echo "$command\n";
echo "$output";
?>