Jump to content

Recommended Posts

Posted

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");?>
Posted

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?

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
  • Recently Browsing   0 members

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