-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
33 lines (32 loc) · 901 Bytes
/
index.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
<?php
/**
* Created by PhpStorm.
* User: admin
* Date: 2018/12/19
* Time: 16:30
*/
//echo phpinfo();die();
//入口文件
include_once ('function.php');
//echo phpinfo();
defined('CONF_EXT') or define('CONF_EXT', '.php');
define('NOW_URL', $_SERVER['REQUEST_URI']);
define('REQUEST_METHOD', $_SERVER['REQUEST_METHOD']) or define('REQUEST_METHOD','NOT');
define('HTTP_REFERER', isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '');
define('IS_GET', REQUEST_METHOD == 'GET' ? true : false);
define('IS_POST', REQUEST_METHOD == 'POST' ? true : false);
define('HTTP_URL',$_SERVER['DOCUMENT_URI']);
$ruleList = explode('/', rtrim(HTTP_URL, '$'));
$name = end($ruleList);
if ($name =='phpinfo'){
phpinfo();
exit();
}
$file = 'leetcode/'.$name.'.php';
if (is_file($file)){
include_once $file;
}elseif(!$name){
echo '没有此文件';
}else{
var_dump($ruleList,$name);
}