Fatal Error Call To Undefined Function Session_register In
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 fatal error: call to undefined function session_unregister() site About Us Learn more about Stack Overflow the company Business Learn more call to undefined function session_is_registered() fix about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x session_is_registered() is deprecated 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 up Fatal error: fatal error call to undefined function session_register() in xampp Call to undefined function session_register() [duplicate] up vote 0 down vote favorite This 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
If Session_is_registered Myusername
username and password sent from Form $myusername=addslashes($_POST['username']); $mypassword=addslashes($_POST['password']); $sql="SELECT id FROM admin WHERE username='$myusername' and passcode='$mypassword'"; $result=mysql_query($sql); $row=mysql_fetch_array($result); $active=$row['active']; $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row if($count==1) { session_register("myusername"); $_SESSION['login_user']=$myusername; header("location: welcome.php"); } else { $error="Your Login Name or Password is invalid"; } } ?> 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 c
here for a quick overview of the site
Session_register W3schools
Help Center Detailed answers to any questions you might session_is_registered not working have Meta Discuss the workings and policies of this site About Us Learn session_register in php w3schools more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags http://stackoverflow.com/questions/15179308/fatal-error-call-to-undefined-function-session-register Users Badges Ask 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 up Call to undefined function session_register() [duplicate] up vote 5 down vote http://stackoverflow.com/questions/16082420/call-to-undefined-function-session-register favorite This question already has an answer here: Fatal error: Call to undefined function session_register() [duplicate] 2 answers Please help me everyone !! why i can't login , and this the error : *Fatal error: Call to undefined function session_register() in C:\xampp\htdocs**\proses1.php on line 27* this proses1.php code : "; exit; } $username = stripslashes($username); $password = stripslashes($password); $username = mysql_real_escape_string($username); $password = mysql_real_escape_string($password); $sql="SELECT login.username, login.password, login.status FROM login WHERE login.username='$username' AND login.password='$password'"; $result=mysql_query($sql) or die(mysql_error()); $count=mysql_num_rows($result); // If result matched $myusername and $mypassword, table row must be 1 row $r=mysql_fetch_array($result); session_start(); session_register("username"); session_register("password"); session_register("status"); //session_register("nojual"); $_SESSION['username']=$r[username]; $_SESSION['password']=$r[password]; $_SESSION['status']=$r[status]; //$_SESSION['nojual']=$r[nojual]; //$_SESSION['nojual']=$r[nojual]; if ($_SESSION['status']=='dokter') // ini untuk admin { header("location:home_dokter.php"); }else if($_SESSION['status']=='apotik'){ header("location:uji.php"); }else if($_SESSION['status']=='bagian persediaan'){ header("
Hello, Noob alert!! I tried to protect some pages with a code I found https://www.daniweb.com/programming/web-development/threads/464412/fatal-error-call-to-undefined-function-session-is-registered googling. But since my server was recently moved to http://dragonprime.net/index.php?topic=12259.0 a better one, the code stoped working and gives me the error "Fatal error: Call 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 call to 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. the code I got on every page I wish to protect include('protect_page.php')?> login.php