SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Arrow DatabaseDrivenWebsite ~p.290 Access.inc.php

    Hey all!
    I am having a little bit of trouble with the login form and access.inc files in my website. The problem is that the login form appears between every page. For example, when I click on 'create new joke' I get a login screen. Then If I type in my username and pass, I get sent to the 'create new joke' form. When I submit the form, it sends me back to the login screen. Typing in the user and pass again sends me to the jokes page, but does not get the form submitted.

    Is there something that is going wrong somewhere in the access.inc.php code? I have a hunch that it has something to do with sessions because sessions are the ones that are supposed to pass on the userIsLoggedIn() function as true.

    I can post my code if you need to see it.

  2. #2
    SitePoint Member
    Join Date
    Oct 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    OK, I have figured out the error that was causing this problem for me. It was a simple typo.

    I was typing:
    session_start();
    $_SESSION['loggedIn'] = TRUE;
    $_SESSION['email'] = $_POST['email'];
    #_SESSION['password'] = $password;
    return TRUE;

    And I should have typed:
    session_start();
    $_SESSION['loggedIn'] = TRUE;
    $_SESSION['email'] = $_POST['email'];
    $_SESSION['password'] = $password;
    return TRUE;

    Did you notice the #_SESSION?? I finally did!

  3. #3
    SitePoint Zealot atetlaw's Avatar
    Join Date
    Feb 2007
    Location
    Melbourne, Australia
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for reporting the resolution!


Tags for this Thread

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
  •