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
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?

Link to comment
Share on other sites

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.