bwakad Posted May 10, 2014 Share Posted May 10, 2014 On this code, when login is not correct I get a internal server error. So the question is what I need to do? <?php if($user->isLoggedin()) { // user is already logged in, so they don't need to be here $session->redirect("/profile/"); } // check for login before outputting markup if($input->post->user && $input->post->pass) { $user = $sanitizer->username($input->post->user); $pass = $input->post->pass; if($session->login($user, $pass)) { // login successful $session->redirect("/profile/"); } } ?> <?php include("./myinclude/head.inc");?> <form action='./' method='post'> <p><label>User <input type='text' name='user' /></label></p> <p><label>Password <input type='password' name='pass' /></label></p> <p><input type='submit' name='submit' value='Login' /></p> </form> <?php include("./myinclude/foot.inc");?> Link to comment Share on other sites More sharing options...
peterfoeng Posted May 13, 2014 Share Posted May 13, 2014 The code looks fine to me. I have a project that implements the login functionality and the code is similar to mine. What sort of internal server error do you get? Link to comment Share on other sites More sharing options...
arjen Posted May 13, 2014 Share Posted May 13, 2014 Have you enabled debug mode or looked at the logs? You should get more information to debug on than "Internal Server Error". 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now