Results 1 to 2 of 2

Thread: Boolean Problems

  1. #1
    Join Date
    Oct 2008
    Posts
    23
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Boolean Problems

    Im trying to alter my section of code so that when i user enters an invalid username or password it displays "invalid" on the same page, and not a new page. i am trying to use a boolean variable to do this, here is my code on the login section.
    Code:
    $failPass = false;
    if ($failPass == true){
    echo'Error';
    
    }else if($_SESSION['LOGGED_IN'] == true) {?>
    I cut the code off to place only the relevant parts.
    On the loginauth page i have this code written.
    Code:
    if ($num_rows <= 0) { 
    
    header('Location: index.php');
    $failPass = true;
    exit; 
    } else {
    However, when the loginauth redirects back to the first page, it does not display "error"
    Please help guide me.

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Your not sending any post data back to the page, your only putting a temporary variable. Search on google how to send post data in a header() if you can't find anything then look at ajax.
    Jeremy | jfein.net

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •