Jump to content

login error


bwakad
 Share

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...