After a PHP web user logs in, the user logs out. before login, only the registration login connection problems are displayed, as shown in the following figure. I use PHP. & lt; div & gt; & lt; ul & gt; & lt ;? Phpsession_start (); echo $ _ SESSION ['username']; & nbsp ;? & Gt; & lt; li & gt; Login & l the PHP webpage user logs in and logs out. only the registration Login connection is displayed before logon.
For example, I use PHP.
Session_start ();
Echo $ _ SESSION ['username'];
?>
- Login
- Apply for user1
- Apply for user2
------------ The above is written in index. php ------------
I want to log on. login, Apply for user1, Apply for user2 are not displayed. only the user name and logout are displayed.
After logging out, login, Apply for user1 .......
Please teach me.
------ Solution --------------------
Please provide the complete index. php code.
------ Solution --------------------
PHP code
- User name
- Cancel
- Login
- Apply for user1
- Apply for user2
------ Solution --------------------
Discussion
PHP code
Session_start ();
?>
- User name
- Cancel
- Login
- Apply ......
------ Solution --------------------
Session_start ();
?>
- User name
- Cancel
- Login
- Apply for user1
- Apply for user2