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']); ?> --------------------------------- Link to comment https://forums.phpfreaks.com/topic/91640-help-needed-how-to-display-user-first-name-after-log-in/ 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'] Link to comment https://forums.phpfreaks.com/topic/91640-help-needed-how-to-display-user-first-name-after-log-in/#findComment-469333 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 Link to comment https://forums.phpfreaks.com/topic/91640-help-needed-how-to-display-user-first-name-after-log-in/#findComment-469338 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 Link to comment https://forums.phpfreaks.com/topic/91640-help-needed-how-to-display-user-first-name-after-log-in/#findComment-470255 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.