By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,805 Members | 1,273 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,805 IT Pros & Developers. It's quick & easy.

Values not set from login session variables

P: 4
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_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);

$_SESSION['session_name'] = $user_name;

$_SESSION['balance']= $balance;

any ideas why this would not be the case and a way to resolve this?
Oct 14 '11 #1

✓ answered 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'];

Share this Question
Share on Google+
3 Replies


Expert Mod 100+
P: 2,327
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'];
Oct 14 '11 #2

P: 4
@Niheel
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
Oct 14 '11 #3

P: 4
after logging in you see 0 showing it works :d
Oct 14 '11 #4

Post your reply

Sign in to post your reply or Sign up for a free account.