nade93 Posted November 13, 2010 Share Posted November 13, 2010 Hi All I am using the following method to check if user is logged in to a member area. However, I ahve a password change section that then redirects back the the password change page within the logged in area. After password changes it automatically redirects back to the index page rather than password page and comes up with a redirect error (too many redirects) How can i change the code to match the new change in password. I think its a sessions problem but not great with sessions! if(isset($_COOKIE['ID_my_site'])) { $username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM member_users WHERE email = '$username'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { $usernameid=$info['username']; $userid = $info['id']; $firstname = $info['fname']; $lastname = $info['lname']; //if the cookie has the wrong password, they are taken to the login page if ($pass != $info['password']) { header("Location: index.php"); } //otherwise they are shown the admin area else { echo "<div class=\"memberloginactive\">Welcome $firstname | Your Profile | <a href=\"edit-profile.php?id=$userid\">Edit Profile</a> | <a href=\"logout.php\">Logout</a></div><div class=\"clear\"></div>"; } } } else { Quote Link to comment https://forums.phpfreaks.com/topic/218584-redirect-loop-for-member-system/ Share on other sites More sharing options...
nade93 Posted November 13, 2010 Author Share Posted November 13, 2010 oh dear been at this for few hours now and still no further, anyone who can help would be my hero Quote Link to comment https://forums.phpfreaks.com/topic/218584-redirect-loop-for-member-system/#findComment-1133916 Share on other sites More sharing options...
BlueSkyIS Posted November 14, 2010 Share Posted November 14, 2010 latest code, please. Quote Link to comment https://forums.phpfreaks.com/topic/218584-redirect-loop-for-member-system/#findComment-1133927 Share on other sites More sharing options...
nade93 Posted November 14, 2010 Author Share Posted November 14, 2010 latest code, please. hi above is the latest code as reverted back when all others seems to break the login system totally i know its a session manipulation but apart from that i am stuck! Quote Link to comment https://forums.phpfreaks.com/topic/218584-redirect-loop-for-member-system/#findComment-1134030 Share on other sites More sharing options...
BlueSkyIS Posted November 14, 2010 Share Posted November 14, 2010 there is no reference to sessions in your code. are we missing part of the code in your post? Quote Link to comment https://forums.phpfreaks.com/topic/218584-redirect-loop-for-member-system/#findComment-1134074 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.