Home | The PHP Group | PHP | Retrieving and dis...
The PHP Group PHP
Problem for The PHP Group PHP

Retrieving and displaying logged in users info




By d_howley on Mar 22, 2009

" "
Hey i need help,
when a user logs in with thier email and password i want to get there first name and display Welcome "username" you are logged in.
on the web pages that the user has to loging to view how would i go about doing something like this...

Thanks in advance :)
Comments:

Mar 25, 2009

- so how would i go about doing the second option i know nearly nothing about sessions in php, i have a checklogin.php script to make sure the user is registered if users is registered then redirect them to XXXX.php would i grab the username at the same time as that it would help if i had a list like what to do and in what order the php scripts would do things in

Solution #1

posted on Mar 24, 2009
Not Rated)

don393

Rank: Apprentice 
Rating: 0%, 0 votes
you had not provided complete detail that if you are having database for username or you want to fetch username from 'email providing site' in which your user created his account.if you are trying for second option,It is almost not possible coz any of the email providing site will not exchange personal detail of any of his acc holder.
if you are trying first option,session in php can help you.you can store username in a session variable n then u can access them on any page if session is not destroyed or expired.

Comments:

Mar 26, 2009

- hi.if u r using form to take username n password,let the name of username holding variable as 'user_name'.then just add two lines in your checklogin.php

session_start();
$_SESSION["name"]=$_POST["user_name"];

and then redirect the script to that page you want.whenever you need to print user_name on any page just type again only two lines

session_start();
print $_SESSION["name"];

u can make any no. of session variables by changing variable name i.e. "name" here n use them like above.no need to start session by " start_session(); " on a single page.
"BEST OF LUCK n KEEP GOING"
Was this helpful?
Yes
No

Popular Solutions for The PHP Group PHP


Questions and Unsolved Problems for The PHP Group PHP


Do you recommend The PHP Group PHP?
Answer

Answer
I want to execute java command for a software which is stored on my web server with the help of... (More)

Answer
subject avaluation system php w/ mysql codes how to evaluate subject using php w/ mysql

Answer
Hi there, I am using PHP5, where i need to mail with attachement. exact thing is, am getting the... (More)

Answer
Hiya Im trying to get a collaspable panel to save state, the example I am currently using is... (More)


Didn't find what you were looking for?

Describe your problem:

Select a Category:





Sponsored Links



Ask our Experts

 

Solve Your Problem Now!
Chat Live with an Expert
Chat Now
Browse popular Problems
More Common Problems
Most Common Problems for:
For The PHP Group PHP:

Top Programming Tool Experts

Rank: Guru Guru  

Solutions: 482
Member Since: October 2009

Experience: Experienced a lot in computer troubleshooting. Knowledgeable about cellular phones.

Ask Me
Find more Programming Tool Experts

Top Computer & Laptop Repair

(877) 934-6198
Send your laptop to us and we will diagnose the...
A+ Rated Oceanside Computer Sales & Service, LLC

(877) 729-0812
We connect to your computer over the Internet to...
Remote Repair


       
Solve Your Problem Now!
Chat Live with an Expert
Chat Now

X
Continue
When the original poster rates a solution that was given to his own problem, that rating is locked!
X

Are you sure the solution content is Inappropriate?
   
Tech buddies can communicate directly to answer questions. Become a Tech Buddy and have direct access to your favorite expert for FREE!
Insert Link
Insert Image
Insert You-Tube clip
Insert List
Insert List
Spell Check

What is this?



Select