Fatal Error Call To Undefined Function Session_register In Php
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack fatal error: call to undefined function session_unregister() Overflow the company Business Learn more about hiring developers or posting ads with us call to undefined function session_is_registered() fix Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a
Session_is_registered() Is Deprecated
community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fatal error: Call to undefined function session_register() [duplicate] up vote 0 down vote favorite This
Fatal Error Call To Undefined Function Session_register() In Xampp
question already has an answer here: PHP/MySQL login 2 answers I'm new to php and was wondering if anyone could help me debug, the following error. Fatal error: Call to undefined function session_register() It occurs as I get a user to login. PHP Error it throws out at line 16 is $active=$row['active']; php share|improve this question asked Mar 2 '13 at 20:50 Sam 1312313 marked as duplicate by mario, cryptic ツ, Ocramius, tereško, Graviton Mar 5 '13 at 1:56 This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question. 5 The function is no longer present in PHP 5.4 –Pekka 웃 Mar 2 '13 at 20:52 It's almost funny that on one line it does session_register and on the very next one it goes on to access $_SESSION directly. –Jon Mar 2 '13 at 20:55 See this SO answer –deepmax Mar 2 '13 at 20:56 add a comment| 2 Answers 2 active oldest votes up vote 3 down vote If you check the php manual, you will see that it has been deprecated How about you use the $_SESSION variable? $_SESSION["myusername"] = $username; share|improve this answer edited May 18 '14 at 21:21 Benjamin 11.4k1693171 answered Mar 2 '13 at 20:54 Ibu 23.9k6427
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of
Session_register W3schools
this site About Us Learn more about Stack Overflow the company Business session_is_registered not working Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask session_register in php w3schools Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign http://stackoverflow.com/questions/15179308/fatal-error-call-to-undefined-function-session-register up PHP Fatal error: Call to undefined function session_register() up vote 6 down vote favorite I have moved my site from php 5.3 to 5.4 and now I cannot login to site admin I see this error: PHP Fatal error: Call to undefined function session_register() in /home/regimhot/public_html/webmotionsV4/mvc/models/kit_model_useri.php on line 18 The code with the problem is: function login($username, $password) { if(!$username || !$password) http://stackoverflow.com/questions/20661991/php-fatal-error-call-to-undefined-function-session-register return false; if($this->useri[$username]['password']==$password) { session_register('userInfo'); $_SESSION['userInfo'] = $this->useri[$username]; $_SESSION['userInfo']['logat'] = true; $this->userInfo = &$_SESSION['userInfo']; How can I solve the problem? i know that the function session_register is not suported by php 5.4 php share|improve this question asked Dec 18 '13 at 15:24 AndreiG. 35114 no need of writing session_register('userInfo') line –Yatin Trivedi Dec 18 '13 at 15:26 add a comment| 2 Answers 2 active oldest votes up vote 16 down vote accepted This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0. http://www.php.net/manual/en/function.session-register.php Make sure you have session_start(), as just removing session_register() and relying on the $_SESSION assignment won't work. share|improve this answer answered Dec 18 '13 at 15:25 Connor Tumbleson 1,8391526 add a comment| up vote 5 down vote Per the documentation, the session_register() function was deprecated in version 5.3.0 and removed from PHP entirely in 5.4.0. I suspect that you're using version 5.4.0. http://www.php.net/manual/en/function.session-register.php share|improve this answer answered Dec 18 '13 at 15:26 Louis 1,94921442 add a comment| Your Answer draft saved draft discarded Sign up or log in Sign up using Google Sign up using Face
Hello, Noob alert!! I tried to protect some pages with a code I found googling. But since my server was recently moved to a better one, https://www.daniweb.com/programming/web-development/threads/464412/fatal-error-call-to-undefined-function-session-is-registered the code stoped working and gives me the error "Fatal error: Call http://dragonprime.net/index.php?topic=12259.0 to undefined function session_is_registered() .../protect_page.php on line 3" I googled it, and I think it's happening because of the version of PHP. I tried to fix it, but no joy! I would appreciate if you could help me! I will paste here the code I have. call to the code I got on every page I wish to protect include('protect_page.php')?> login.php