jimweldon Posted December 11, 2010 Share Posted December 11, 2010 Hi, My host upgrade PHP yesterday and broke some code on my site. My developer is not avail... ERROR MSSG: Deprecated: Function session_is_registered() is deprecated in...followed by directory Here's the live of code that contains the error. if(!isset($_POST[$param_name]) && !isset($_GET[$param_name]) && session_is_registered($param_name)) Im assuming it has to do with "session_is_registered". Any ideas? Thx. Link to comment https://forums.phpfreaks.com/topic/221340-deprecated-function-session_is_registered-is-deprecated-in/ Share on other sites More sharing options...
jimweldon Posted December 11, 2010 Author Share Posted December 11, 2010 } function get_session($param_name) { $param_value = ""; if(!isset($_POST[$param_name]) && !isset($_GET[$param_name]) && session_is_registered($param_name)) $param_value = $_SESSION[$param_name]; return $param_value; } Link to comment https://forums.phpfreaks.com/topic/221340-deprecated-function-session_is_registered-is-deprecated-in/#findComment-1145884 Share on other sites More sharing options...
Pikachu2000 Posted December 11, 2010 Share Posted December 11, 2010 Try this change to the if(). if(!isset($_POST[$param_name]) && !isset($_GET[$param_name]) && isset($_SESSION[$param_name])) Link to comment https://forums.phpfreaks.com/topic/221340-deprecated-function-session_is_registered-is-deprecated-in/#findComment-1145885 Share on other sites More sharing options...
jimweldon Posted December 11, 2010 Author Share Posted December 11, 2010 thanks that worked! Link to comment https://forums.phpfreaks.com/topic/221340-deprecated-function-session_is_registered-is-deprecated-in/#findComment-1145908 Share on other sites More sharing options...
jimweldon Posted December 11, 2010 Author Share Posted December 11, 2010 I need to modernize the code. Any ideas. thx. } function set_session($param_name, $param_value) { if(session_is_registered($param_name)) session_unregister($param_name); $_SESSION[$param_name] = $param_value; session_register($param_name); } Link to comment https://forums.phpfreaks.com/topic/221340-deprecated-function-session_is_registered-is-deprecated-in/#findComment-1145913 Share on other sites More sharing options...
BlueSkyIS Posted December 11, 2010 Share Posted December 11, 2010 I would follow Pikachu2000's example. Pikachu2000 only changed one thing in that line. You just need to follow that example. Link to comment https://forums.phpfreaks.com/topic/221340-deprecated-function-session_is_registered-is-deprecated-in/#findComment-1145930 Share on other sites More sharing options...
drytech Posted August 2, 2013 Share Posted August 2, 2013 This morning I opened my site to find this at the top of the page: Deprecated: Function session_is_registered() is deprecated in /home/trafficr/public_html/config.php on line 37 Deprecated: Function session_register() is deprecated in /home/trafficr/public_html/members/index.php on line 9 I tried replacing session_is_registered with $_SESSION but that completely broke the site. I am not sure what to do. I am not a php coder and know nothing about it. This is a traffic exchange that has a lot of members, so I want to fix it as quickly as possible. Any ideas? Link to comment https://forums.phpfreaks.com/topic/221340-deprecated-function-session_is_registered-is-deprecated-in/#findComment-1443150 Share on other sites More sharing options...
jParnell Posted August 2, 2013 Share Posted August 2, 2013 This morning I opened my site to find this at the top of the page: Deprecated: Function session_is_registered() is deprecated in /home/trafficr/public_html/config.php on line 37 Deprecated: Function session_register() is deprecated in /home/trafficr/public_html/members/index.php on line 9 I tried replacing session_is_registered with $_SESSION but that completely broke the site. I am not sure what to do. I am not a php coder and know nothing about it. This is a traffic exchange that has a lot of members, so I want to fix it as quickly as possible. Any ideas? Try replacing function session_is_registered() with: if(isset($_SESSION[''])){ } // replace whatever is in the (*) on the original inside the ['*'] on the new as well, replace function session_register() with this line: $_SESSION['*'] = $_REQUEST['*'} // Replace the asterisks with what was in the parentheses in the original Link to comment https://forums.phpfreaks.com/topic/221340-deprecated-function-session_is_registered-is-deprecated-in/#findComment-1443155 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.