我怎样才能在 phpbb 3.1 中获得 "DOCUMENT_ROOT"?
How can I get "DOCUMENT_ROOT" in phpbb 3.1?
我试过用这个
require $_SERVER['DOCUMENT_ROOT'] . '/lib/MyClass.php';
但是我收到了这条消息
Illegal use of $_SERVER. You must use the request class or request_var() to access input data
我曾尝试使用 request_var(),但它不起作用。
如何在 phpbb 3.1 中获得 "DOCUMENT_ROOT"?
我找到了这个问题的下一个决定 - 使用 filter_input 而不是 $_SERVER。
require filter_input(INPUT_SERVER, 'DOCUMENT_ROOT') . '/lib/MyClass.php';
我试过用这个
require $_SERVER['DOCUMENT_ROOT'] . '/lib/MyClass.php';
但是我收到了这条消息
Illegal use of $_SERVER. You must use the request class or request_var() to access input data
我曾尝试使用 request_var(),但它不起作用。
如何在 phpbb 3.1 中获得 "DOCUMENT_ROOT"?
我找到了这个问题的下一个决定 - 使用 filter_input 而不是 $_SERVER。
require filter_input(INPUT_SERVER, 'DOCUMENT_ROOT') . '/lib/MyClass.php';