eva9 Posted February 18, 2008 Share Posted February 18, 2008 Hi, wonder if anyone can help me with this. I wanted to have user information, ex. "Welcome, [firstname]" display after they log in, how do I do that? anyone can help? ??? ??? Here's part of the Login scripts I used: ------------------------------- <?php $qry="SELECT member_id FROM members WHERE login='$login' AND passwd='".md5($_POST['password'])."'"; $result=mysql_query($qry); ?> ------------------------------- <?php if(mysql_num_rows($result)>0) { session_regenerate_id(); $member=mysql_fetch_assoc($result); $_SESSION['SESS_MEMBER_ID']=$member['member_id']; session_write_close(); header("location: member-index.php"); exit(); } ?> -------------------------------- <?php session_start(); if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID'])=='')) { header("location: access-denied.php"); exit(); } ?> -------------------------------- <?php session_start(); unset($_SESSION['SESS_MEMBER_ID']); ?> --------------------------------- Quote Link to comment Share on other sites More sharing options...
priti Posted February 18, 2008 Share Posted February 18, 2008 upate your script to fetch firstname of user also. $qry="SELECT member_id,member_firstname FROM members WHERE login='$login then $_SESSION['SESS_First_NAME']=$member['member_firstname']; and ahead you can use i suppose where ever you want to echo it you can welcome. $_SESSION['SESS_First_NAME'] Quote Link to comment Share on other sites More sharing options...
eva9 Posted February 18, 2008 Author Share Posted February 18, 2008 I got it!! thanks so much priti Quote Link to comment Share on other sites More sharing options...
priti Posted February 19, 2008 Share Posted February 19, 2008 I got it!! thanks so much priti you most welcome Quote Link to comment 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.