phpbb 3.1 passing variable between 2 pages

半城伤御伤魂 提交于 2019-12-06 16:47:31

I'm not sure if $_SESSION is included, but try phpBBs request class...

$example = $request->variable('example','');

Docs for the class are here - https://wiki.phpbb.com/PhpBB3.1/RFC/Request_class

You might want to take a look at this answer, where I explained that you can also temporarily (or globally) switch Superglobals back:

Globally

Open the /phpbb/config/parameters.yml file and change the core.disable_super_globals key from true to false.

Programmatically

This is a sample code that can be used to temporarily enable superglobals (per-request scope):

// temporarily enable superglobals
$request->enable_super_globals();

// TODO: do your stuff here.

// disable superglobals again
$request->disable_super_globals();

You can also read this blog post that I wrote on this topic for further info.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!