In PHP, how can I obtain the username and password of a user when logging on to a php system, because I need to query the database based on the user name on another page to obtain other values of this user and put them in the text box. I probably know that session and cookie are used, but I don't know how to write it. I hope you can give a sample code. ------ Solution ------------------ the system logon value in PHP at the logon location
I would like to ask, how can I obtain the username and password of a user when I log on to a php system, because I need to query the database based on the user name on another page to obtain other values of this user and put them in the text box. I probably know that session and cookie are used, but I don't know how to write it. I hope you can give a sample code.
------ Solution --------------------
At the beginning of the login process page
...
...
Judgment, result set is not empty {
$ _ SESSION ["name"] = $ _ POST ['name']; get the session value
}
When using other pages
You can.
------ Solution --------------------
A. php page content
Untitled Document
B. php page content
Session_start (); // keep it in mind !!!
?>
Untitled Document
If ($ _ POST [tijiao])
{
Echo "username: $ _ POST [name] Password: $ _ POST [pass]";
}
?>