简体   繁体   中英

authenticated user can access their details

i am confused in how to create and relate 2 datbases ie user authentication database and database having details of a particular user. I want a particular user after login can access his details whatever it is present in his details database I am using php and mysql (xampp). plz suggest me a slution. thanks in advance

Your problems really too vague to know what you need. But what you essentially need to do is

  1. Create a form that has the fields "username" and "password"
  2. Check username and password with database after form is sent
  3. If authenticated, save cookie/session or whatever
  4. If cookie/session exists, display users information

For this problem, you would have 2 tables, an authentication one and a details one. The rows on each table is connected by with an ID, so the row on the first table with an ID of 1 will be related to the row on the second table with an ID of 1.

However, you would have to relate them, the ID of the user would be stored as a cookie/session and be referred to when selecting information from the database

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM