Log in

View Full Version : Page Variables


Rachael
07-23-2007, 09:51 PM
I've inherited a site with an old version of Vbulletin that has some custom pages that use global.php for session variables, etc. The custom pages would normally collect variables directly using register globals, instead of $_GET or $_POST. This all worked fine despite the use of register globals.

I've upgraded Vbulletin to 3.6.7, but now variables being passed into pages are not seen once global.php is included in the page.

Is there a way I can get the variable values directly instead of using $_GET or $_POST as there are hundreds of pages?

:)

Antivirus
07-23-2007, 09:56 PM
maybe by including some code within hook location: global_start will do it for you?

Rachael
07-23-2007, 10:02 PM
Do you mean add some global code to translate the $_GET or $POST variables to the original ones? Problem is there are hundreds of different variables used across these pages.

Dismounted
07-24-2007, 11:30 AM
Bad coding style to rely on register globals. But it probably could be achieved by using variable variables:
$superglobals = array_merge($_POST, $_GET);

foreach ($superglobal AS $name => $value)
{
$$name = $value
}