Learning Posted July 17, 2014 Share Posted July 17, 2014 I am a newbie to this forum and a real beginner on PHP After the website went down after the server upgrade to 5.4.30, parts came back but in other places got 2 error messages. 1. Home page - Login by members Fatal Error: call to undefined function session_is_registered() in member_auth_fns.php on line 28 2. Admin - Login by me Parse error: syntax error, unexpected '$_SESSION' (T_VARIABLE), expecting '(' in contacts/user_auth_fns.php line 28 I appreciate that the old php was based on session_start (), session_register, session_is_registered, session_unregister, but these were all deprecated in 5.4.30. So to put it bluntly, after trying to interpret the help manuals etc I found a backup I had taken before this and in respect of the Home page login and the admin login what I think was the previous relevant code was before the event <? function login ($member_name, $password) // check member and password with db // if yes, return true //else return false { // connect to db $conn = db_connect(); if (!$conn) return 0; $result = MySQL_query(select * from people where username='$member_name' and password = '$password' "); if (!$result) return 0; if (MySQL_num_rows($result)>0) return 1; else return; } function check_auth_member Some text here global $auth_member; if ( (session_is_registered("auth_member")) && (isset($auth_member)) ) return true; else return false } ?> Anyone who can give me the revised code for this it would be greatly appreciated Learner Quote Link to comment Share on other sites More sharing options...
trq Posted July 17, 2014 Share Posted July 17, 2014 That code is in some serious need of being thrown out. The session_is_registered function is deprecated. The mysql_* extension is deprecated Short tags have long been disabled by default. And in general it's just poor code. Moving forward, you might want the code maintained. 1 Quote Link to comment 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.