dario Posted April 18, 2014 Share Posted April 18, 2014 I have a problem when I try to log into my website it looks like my login check function always says the login is failed. I have no errors or something it just never works to log in succesfully i dont have a clue how i have to solve this =( functions.php process_login.php login.php protected_page.php Quote Link to comment Share on other sites More sharing options...
dario Posted April 18, 2014 Author Share Posted April 18, 2014 I got the code from this tutorial maybe it helps. http://www.wikihow.com/Create-a-Secure-Login-Script-in-PHP-and-MySQL Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted April 18, 2014 Share Posted April 18, 2014 (edited) the point of tutorials are for you to learn from them. rather than you just repeatedly dumping all your code and errors/symptoms on a programming help forum and expect someone else to find and tell you what to do (we already know how to read and troubleshoot code and don't need the practice), what debugging have you done to find out what the code is doing? btw - the 'secure' login script you found and are trying to follow is just a demonstration of the secure login concepts the author came up with and it is not a well written or usable script. it's a minimal 'application' and lacks error checking logic that would tell you if and why things like queries are failing. Edited April 18, 2014 by mac_gyver Quote Link to comment Share on other sites More sharing options...
dario Posted April 18, 2014 Author Share Posted April 18, 2014 well im looking for the solution for about 1 hour and with no result. i'm a php beginner that's why i posted this topic. I have read the login check function for about 50 times and I really dont see the bug in it. i have made new user's in my database to check if it was the user that was causing the bug. I really want to learn from this but its just that looking for something you dont know yet is pretty damn hard. once i see how its done once i will never have to ask it again. Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted April 18, 2014 Share Posted April 18, 2014 (edited) the code from the tutorial site works, there's no specific bug in it to be found. it just has shortcomings that make it unsuitable for use on a real web site. you need to determine what the code is doing when it runs to find at what point it is not doing what you expect in order to find what the problem is. for anyone here to help, you need to state what does happen when you submit the login form (even a blank-page is a clue) in order to narrow down the dozens of possibilities to just a few things to check further. Edited April 18, 2014 by mac_gyver Quote Link to comment Share on other sites More sharing options...
dario Posted April 18, 2014 Author Share Posted April 18, 2014 the function login_check checks the user_id and the login_string. that seems to work as you said so. can it be when i click login to go to the other page that it doesnt see that i logged in or something? 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.