Jump to content

Login form not logging in


JeanieTallis

Recommended Posts

I don't know what part is causing the problem.

Login goes to session, and checks if username and password is correct, if no errors it then it updates fields eg: (last login) etc,  and then it sets the cookie, then returns true; which I think then goes to process, then it takes you back to the URL referer which is index.php, as it knows your logged in, due to cookies, it shows what it should show to logged in users.

 

What should I post?

Link to comment
Share on other sites

   function procLogin(){
      global $session, $form;
      /* Login attempt */
      $retval = $session->login($_POST['user'], $_POST['pass'], isset($_POST['remember']));
      
      /* Login successful */
      if($retval){
         header("Location: ".$session->referrer);
      }
      /* Login failed */
      else{
         $_SESSION['value_array'] = $_POST;
         $_SESSION['error_array'] = $form->getErrorArray();
         header("Location: ".$session->referrer);
      }
   }

 

Instead of 'header("location: ".$session->referrer);

after, if($retval), I put echo("no error here"); it displays echo, so, index.php (login) goes to process.php, which then is right. then process.php includes session.php, which just checks for errors, and then registers session values (cookies for 'remember me' option) I've tried all if's in all them. No idea what else to try, session.php includes form (just sets error fields) database, which has confirms user and pass, which also sets errors if the username or password isn't correct, and I know they work. (I tested using incorrect details) I can't think of where else to try. seeing as, if the username and password are correct, it would return 0;

 

Would anyone mind adding my MSN and look at it for me?

Link to comment
Share on other sites

All error fields work the way they should do.

I may add, index.php goes to session.php which then uses process.php and process.php works, but its just not recognising its logged in. which is why it refreshes the page, so it checks the database, but just doesn't log in.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.