Alecdude Posted December 10, 2008 Share Posted December 10, 2008 How do I check a user's info based on the ID? All help is appreciated, ASAP. Quote Link to comment https://forums.phpfreaks.com/topic/136284-solved-i-need-to-know-how-to-access-a-users-information-using-their-id-edit/ Share on other sites More sharing options...
premiso Posted December 10, 2008 Share Posted December 10, 2008 <?php session_start(); // need this at the top of each page where sessions are used. include 'dbc.php'; $full_name = mysql_real_escape_string($_POST['email']); if ($_POST['Submit']=='Login') { $md5pass = md5($_POST['pwd']); $sql = "SELECT id,full_name,Money FROM users WHERE full_name = '$full_name' AND user_pwd = '$md5pass' AND user_activated='1'"; $result = mysql_query($sql) or die (mysql_error()); $num = mysql_num_rows($result); if ( $num != 0 ) { // A matching row was found - the user is authenticated. // session_start(); list($user_id,$full_name) = mysql_fetch_row($result); // this sets variables in the session $_SESSION['user']= $full_name; $_SESSION['user_id'] = $user_id; if (isset($_GET['ret']) && !empty($_GET['ret'])) { header("Location: $_GET[ret]"); } else { header("Location: myaccount.php"); } //echo "Logged in..."; exit(); } header("Location: login.php?msg=Invalid Login"); //echo "Error:"; exit(); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/136284-solved-i-need-to-know-how-to-access-a-users-information-using-their-id-edit/#findComment-710963 Share on other sites More sharing options...
Alecdude Posted December 10, 2008 Author Share Posted December 10, 2008 THANK YOU SO MUCH! That worked. Now I need my second problem solved. Quote Link to comment https://forums.phpfreaks.com/topic/136284-solved-i-need-to-know-how-to-access-a-users-information-using-their-id-edit/#findComment-710971 Share on other sites More sharing options...
Alecdude Posted December 10, 2008 Author Share Posted December 10, 2008 I need this info ASAP. Not to be bossy or anything, but I have a deadline. Quote Link to comment https://forums.phpfreaks.com/topic/136284-solved-i-need-to-know-how-to-access-a-users-information-using-their-id-edit/#findComment-710992 Share on other sites More sharing options...
premiso Posted December 10, 2008 Share Posted December 10, 2008 I need this info ASAP. Not to be bossy or anything, but I have a deadline. Pay someone to do it. It sucks for you to have a deadline, honestly not my problem. Quote Link to comment https://forums.phpfreaks.com/topic/136284-solved-i-need-to-know-how-to-access-a-users-information-using-their-id-edit/#findComment-710995 Share on other sites More sharing options...
Alecdude Posted December 10, 2008 Author Share Posted December 10, 2008 I need this info ASAP. Not to be bossy or anything, but I have a deadline. Pay someone to do it. It sucks for you to have a deadline, honestly not my problem. But, I figured one of you guys would know how to, as I thought info like this would be pretty basic. Quote Link to comment https://forums.phpfreaks.com/topic/136284-solved-i-need-to-know-how-to-access-a-users-information-using-their-id-edit/#findComment-710998 Share on other sites More sharing options...
chronister Posted December 10, 2008 Share Posted December 10, 2008 I need this info ASAP. Not to be bossy or anything, but I have a deadline. Pay someone to do it. It sucks for you to have a deadline, honestly not my problem. But, I figured one of you guys would know how to, as I thought info like this would be pretty basic. Chances are many folks here can do it. But when a person starts saying "I need this asap" or "I need this by tomorrow" or any other variation of urgency, then we tend to not care. It is not our problem that you have a deadline and don't know how to do what your supposed to do. We donate our time to help folks on here. If you need something that bad, then either wait until someone answers you or pay someone to do it, because again, your deadline is not our problem. You did not even state what your second problem was. Nate Quote Link to comment https://forums.phpfreaks.com/topic/136284-solved-i-need-to-know-how-to-access-a-users-information-using-their-id-edit/#findComment-711005 Share on other sites More sharing options...
Alecdude Posted December 10, 2008 Author Share Posted December 10, 2008 I need this info ASAP. Not to be bossy or anything, but I have a deadline. Pay someone to do it. It sucks for you to have a deadline, honestly not my problem. But, I figured one of you guys would know how to, as I thought info like this would be pretty basic. Chances are many folks here can do it. But when a person starts saying "I need this asap" or "I need this by tomorrow" or any other variation of urgency, then we tend to not care. It is not our problem that you have a deadline and don't know how to do what your supposed to do. We donate our time to help folks on here. If you need something that bad, then either wait until someone answers you or pay someone to do it, because again, your deadline is not our problem. You did not even state what your second problem was. Nate Sorry for my impatience. And, the second problem is that I need to figure out how to access the user's information using the ID. Again, sorry. Quote Link to comment https://forums.phpfreaks.com/topic/136284-solved-i-need-to-know-how-to-access-a-users-information-using-their-id-edit/#findComment-711009 Share on other sites More sharing options...
premiso Posted December 10, 2008 Share Posted December 10, 2008 $sql = "SELECT id,full_name,Money FROM users WHERE id = " . $_SESSION['user_id']; Quote Link to comment https://forums.phpfreaks.com/topic/136284-solved-i-need-to-know-how-to-access-a-users-information-using-their-id-edit/#findComment-711025 Share on other sites More sharing options...
haku Posted December 10, 2008 Share Posted December 10, 2008 I agree with the others. Demanding makes me have zero interest in helping... for free. Quote Link to comment https://forums.phpfreaks.com/topic/136284-solved-i-need-to-know-how-to-access-a-users-information-using-their-id-edit/#findComment-711029 Share on other sites More sharing options...
jnerotrix Posted December 10, 2008 Share Posted December 10, 2008 I think its still ok to help the people Quote Link to comment https://forums.phpfreaks.com/topic/136284-solved-i-need-to-know-how-to-access-a-users-information-using-their-id-edit/#findComment-711030 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.