you should access the $_SESSION superglobal directly instead of using these deprecated functions:
- session_register()
- session_unregister()
- session_is_registered()
you can find dirty fixes on the net, like defining similar functions if they don't exist but
i'm not sure they can work under all circumstances. you might be lucky if you only have to change
showcase/inc/func.inc.php or similar includefiles. anyway you can try to put the following snippet
at the beginning of your scripts or your bootstrap file (if you have one) and see if it works:
Code:
session_start();
if (!function_exists('session_register')) {
function session_register() {
$args = func_get_args();
foreach ($args as $key) {
global $$key;
$_SESSION[$key] = $$key;
$$key = &$_SESSION[$key];
}
}
function session_is_registered($key) {
return array_key_exists($key, $_SESSION);
}
function session_unregister($key) {
unset($_SESSION[$key]);
}
}
session_register() started the session implicitly if not done yet, that's why you would have to call
session_start() early in your script like at the very beginning and before using the session array
if you did not call session_start() already.
session_register() could also be called with variable argument list (multiple parameters at once), that's
why the func_get_args() is used above.
the reference sharing (the ampersand before $_SESSION in session_register()) did not work here as i would expect,
but there is chance it doesn't matter if you just set some simple session vars at the beginning of a script and
they dont get updated.
in case you want to update your scripts the right way i guess you would use the session array directly as done in these
functions, and use it also directly instead of some global variables that you might have registered until now.
so instead of
Code:
$myGlobalVar = 123;
...
session_register("myGlobalVar");
you use
Code:
$_SESSION['myGlobalVar'] = 123;
and array_key_exists() and unset().
i can not test the original functionality because i don't have the php version, so i cannot guarantee it works. and who knows
what's the next fatal error if the first one gets fixed..
anyway and enjoy you vacation first
