Jump to content

get current registered user's details.


osherdo

Recommended Posts

Hello everyone.

 

I have a fully working form that gets data from a user (with $_post array) , and stores it in a database (mysql).

 

After successfulIy filling the form, I refer him to the "dashboard" page. In this page, i am having trouble to get his details from the database. How should I recognize him as the user that just registered?

 

should I use a $_post? or maybe a session? could you please give me a clue how to solve this? 

Link to comment
https://forums.phpfreaks.com/topic/293226-get-current-registered-users-details/
Share on other sites

You need session_start(); at the top of any page that will use session. When you log the user in, fill session with their appropriate details. You can then check $_SESSION['some_var'] on any other pages to check that they are logged in and do things like display their username, or whatever you want to do. Have you read up on sessions?

It's not complex, just new to you. Wherever a user can go once they are logged in will require session_start() at the top of the page as CroNiX stated. Absolutely, post any questions, along with relevant code, that's what everyone is here for - to assist you in the journey.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.