Home php User Account

User Account




How to make it so that when logging to the site (login, password), the user entered his personal account, i.e. I saw only your posts, etc. How to display a query for the database, I understand, but how to do so as not to enter a login password on each page.

Answer 1, Authority 100%

Read by session_start () and $ _ session

Authorization page:
  & lt;? php
   session_start ();
   $ _Session ['User'] = "Irina";
   echo 'you entered as:' $ _ session ['user'];
  ? & gt;
Personal Area:
& lt;?
 session_start ();
 Echo $ _session ['User']. ', Welcome to your account';
? & gt;

Answer 2, Authority 50%

sessions, read, learn, use

Answer 3, Authority 50%

After successful authorization, write down user data in cookies or sessions.

Check the availability of data in cookies and sessions, if any, check on the database on the loyalty of these data, then allow you to work further.

Answer 4

Well, in order not to output anything on each page – you need to transfer a repeated fragment into a plug-in file. Well, accordingly, connect it using include.

Answer 5

Soon on the hashkode will ask – “how to wash the down jacket.”
Here is an example of registration, the database and sessions are used, in the subject there are examples using files and databases to record users and passwords.

Example of authorization / registration / exit (on files and database)

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions