hamza Posted May 4, 2010 Share Posted May 4, 2010 i am getting error Fatal error: Call to undefined function session_register() how i can resolve this?? Quote Link to comment https://forums.phpfreaks.com/topic/200675-sessoin_register/ Share on other sites More sharing options...
Alex Posted May 4, 2010 Share Posted May 4, 2010 You should not be using session_register in the first place. It's depreciated as of PHP 5.3.0. Instead use $_SESSION session_start(); $_SESSION['var'] = 'val'; session_start Quote Link to comment https://forums.phpfreaks.com/topic/200675-sessoin_register/#findComment-1053059 Share on other sites More sharing options...
PFMaBiSmAd Posted May 4, 2010 Share Posted May 4, 2010 Edit: Basically says the same as above ^^ session_register(), session_is_registered(), and session_unregister() were depreciated 8 years ago, finally throw a depreciated error in php5.3, and have been completely removed in php6. You should not even know there is a function named session_register(). Either someone disabled it in your php version or you are using php6. To set or reference a session variable, you use the $_SESSION array (also requires a session_start() statement on any page the sets or references a session variable) - $_SESSION['some_name'] = some_value; if(isset($_SESSION['some_name'])){ // do something if the variable is set echo $_SESSION['some_name']; } Quote Link to comment https://forums.phpfreaks.com/topic/200675-sessoin_register/#findComment-1053063 Share on other sites More sharing options...
hamza Posted May 4, 2010 Author Share Posted May 4, 2010 Edit: Basically says the same as above ^^ session_register(), session_is_registered(), and session_unregister() were depreciated 8 years ago, finally throw a depreciated error in php5.3, and have been completely removed in php6. You should not even know there is a function named session_register(). Either someone disabled it in your php version or you are using php6. To set or reference a session variable, you use the $_SESSION array (also requires a session_start() statement on any page the sets or references a session variable) - $_SESSION['some_name'] = some_value; if(isset($_SESSION['some_name'])){ // do something if the variable is set echo $_SESSION['some_name']; } if a project is already coded in old php version and using old function . then what is the possible solution for it to remover these errors. Quote Link to comment https://forums.phpfreaks.com/topic/200675-sessoin_register/#findComment-1053086 Share on other sites More sharing options...
PFMaBiSmAd Posted May 4, 2010 Share Posted May 4, 2010 Given that the function is not present in the php version you are using and the code won't work at all, the solution is to update the code to current php standards. Ref: http://en.wikipedia.org/wiki/Deprecation Quote Link to comment https://forums.phpfreaks.com/topic/200675-sessoin_register/#findComment-1053101 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.