U
U
urght2015-10-31 20:58:29
PHP
urght, 2015-10-31 20:58:29

Question about cookies and db?

There are cookies:
id
hash
We need to take the id from the cookies and display the user login with this id from the database and display it here:
$username =
Please help c:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2015-11-01
@urght

You can read cookies in php in this way
$_COOKIE["name"] - where name is the name of the cookie .
You make a query to the database like
"SELECT id, username FROM users WHERE id = " .$_COOKIE["id"];

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question