Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.