Create index.php

pull/4/head
qkqpttgf 2019-12-30 22:15:35 +08:00 committed by GitHub
parent 5a982c36bb
commit 2d18cc8167
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 24 additions and 0 deletions

24
index.php Normal file
View File

@ -0,0 +1,24 @@
<?php
include 'conststr.php';
echo '<pre>' . json_encode($_SERVER, JSON_PRETTY_PRINT) . '</pre>';
if (!isset($_SERVER['REDIRECT_URL'])) $_SERVER['REDIRECT_URL'] = '/index.php';
if ($_SERVER['REDIRECT_URL']=='') $_SERVER['REDIRECT_URL']='/';
$path = $_SERVER['REDIRECT_URL'];
$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);
foreach ($getstrarr as $getvalues) if ($getvalues!='') {
$pos = strpos($getvalues,"=");
//echo $pos;
if ($pos>0) {
$getarry[urldecode(substr($getvalues,0,$pos))] = urldecode(substr($getvalues,$pos+1));
} else $getarry[urldecode($getvalues)] = true;
}
if (isset($getarry)) {
$_GET = $getarry;
} else $_GET = '';
echo '<pre>' . json_encode($_GET, JSON_PRETTY_PRINT) . '</pre>';