Values not set from login session variables

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jamieduk
    New Member
    • Mar 2010
    • 4

    Values not set from login session variables

    i know i need to use session logged in user id and do jot know how or the other way is to pull data from feild name balance where logged in user id matches then gets there balance somehow either way i end up back to this problem and do not know how to get around it but it must be setup so that they can only resaults that concern them if this makes sense how is this possible on other sites that might need this?

    the loggin should set the var $id with the following

    $_SESSION['user_id']= $id;

    $_SESSION['user_name'] = $full_name;

    $_SESSION['user_level'] = $user_level;

    $_SESSION['HTTP_USER_AGEN T'] = md5($_SERVER['HTTP_USER_AGEN T']);

    $_SESSION['session_name'] = $user_name;

    $_SESSION['balance']= $balance;

    any ideas why this would not be the case and a way to resolve this?
    Last edited by Niheel; Oct 14 '11, 06:49 PM. Reason: your 2nd question has been moved to it's own thread, and the two posts merged.
  • Niheel
    Recognized Expert Moderator Top Contributor
    • Jul 2005
    • 2433

    #2
    Your code doesn't set the var $id.

    Instead it's setting session variable.

    To set the variable $id with session data that seems to be set at login. You would do the following:

    $id = $_SESSION['user_id'];
    niheel @ bytes

    Comment

    • jamieduk
      New Member
      • Mar 2010
      • 4

      #3
      Solved

      Originally posted by Niheel
      Your code doesn't set the var $id.

      Instead it's setting session variable.

      To set the variable $id with session data that seems to be set at login. You would do the following:

      $id = $_SESSION['user_id'];
      you have just made my day and night and you sir deserv a medal it works perfect :d
      to see it in action it will be up on jnet2012.0fees. net in about 10 minits lol

      Comment

      • jamieduk
        New Member
        • Mar 2010
        • 4

        #4
        after logging in you see 0 showing it works :d
        Last edited by Niheel; Oct 14 '11, 08:27 PM. Reason: no worries, good luck :) removed link, uncessary.

        Comment

        Working...