Php5.3 does not support session_register (). What should I do if this function is enabled?
- // Fix for removed Session functions
- Function fix_session_register (){
- Function session_register (){
- $ Args = func_get_args ();
- Foreach ($ args as $ key ){
- $ _ SESSION [$ key] = $ GLOBALS [$ key];
- }
- }
- Function session_is_registered ($ key ){
- Return isset ($ _ SESSION [$ key]);
- }
- Function session_unregister ($ key ){
- Unset ($ _ SESSION [$ key]);
- }
- }
- If (! Function_exists ('session _ register ') fix_session_register ();
- ?>
-
Find another method and change session_register ("abc") to $ _ SESSION ['ABC'] = null. Session changes in php5.3 (bbs.it-home.org script School) in php5.3 run the following code: Function session_is_registered () is deprecated inFunction session_register () is deprecated in, that is, these two functions are not in favor of use. The following is the code in the php official Manual. the comments section shows that session_register () is not supported ()
- // Use of session_register () is deprecated does not approve of session_register ()
- $ Barney = "A big purple dinw.ur .";
- Session_register ("barney ");
- // Use of $ _ SESSION is preferred, as of PHP 4.1.0 preferred $ _ SESSION
- $ _ SESSION ["zim"] = "An invader from another planet .";
- // The old way was to use $ HTTP_SESSION_VARS
- $ HTTP_SESSION_VARS ["spongebob"] = "He's got square pants .";
- ?>
-
The following warning and prompt is displayed: WarningThis function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0. Warning: This function is not recommended in php5.3 and has been removed from php5.4. If $ _ SESSION (or $ HTTP_SESSION_VARS for PHP 4.0.6 or less) is used, use isset () to check a variable is registered in $ _ SESSION. Tip: If $ _ SESSION is used, check using the isset () function. If you are using $ _ SESSION (or $ HTTP_SESSION_VARS), do not use session_register (), session_is_registered () and session_unregister (). |