From b130aa70ac8c4b601abb8faea7f239a4fc2bdfe3 Mon Sep 17 00:00:00 2001 From: qkqpttgf <45693631+qkqpttgf@users.noreply.github.com> Date: Mon, 30 Dec 2019 22:39:59 +0800 Subject: [PATCH] Update index.php --- index.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index c97d92a..fa51835 100644 --- a/index.php +++ b/index.php @@ -6,6 +6,10 @@ if (!isset($_SERVER['REDIRECT_URL'])) $_SERVER['REDIRECT_URL'] = '/index.php'; if ($_SERVER['REDIRECT_URL']=='') $_SERVER['REDIRECT_URL']='/'; $path = $_SERVER['REDIRECT_URL']; echo 'path:'.$path; +$_GET = getGET(); + +function getGET() +{ $getstr = substr(urldecode($_SERVER['REQUEST_URI']), strlen(urldecode($_SERVER['REDIRECT_URL']))); while (substr($getstr,0,1)=='/' || substr($getstr,0,1)=='?') $getstr = substr($getstr,1); $getstrarr = explode("&",$getstr); @@ -17,8 +21,8 @@ $getstr = substr(urldecode($_SERVER['REQUEST_URI']), strlen(urldecode($_SERVER[' } else $getarry[urldecode($getvalues)] = true; } if (isset($getarry)) { - $_GET = $getarry; - } else $_GET = ''; - + return $getarry; + } else return ''; +} echo '
' . json_encode($_GET, JSON_PRETTY_PRINT) . '
';