PHPBB3and super globals?

549 views Asked by At

I try to customize my PHPBB3 interface. For that I need to include a header and a footer.

The header file I try to include has the use of...

$this->_agent = $_SERVER['HTTP_USER_AGENT'];

...wrapped in a function.

Here is the error message when I open the PHPBB3 index page:

Illegal use of $_SERVER. You must use the request class or request_var() to access input data.

For info, the file I try to include works well in any other context than PHPBB3.

Can someone tell me what I have to do and where I have to do it in order to get rid of this error message and have my included file work properly?

Thank you.

1

There are 1 answers

1
Alexandre Tranchant On

You only have to use the request_var() function to access your datas.

$userAgent = request_var('HTTP_USER_AGENT','');

You can find more information about this function here :

https://wiki.phpbb.com/Function.request_var