I made a check for authorization, and if the user is logged in, then write "Welcome, ***", "You have .... game coins" (because I am doing a game project). But after transferring data using the POST method, the fields do not disappear anywhere, and the greeting appears immediately under the block with the fields. Tell me how to do it instead of the authorization block, a block with a greeting and similar information. Here is the whole code:
<?php if(!isset($_SESSION['name'])) { echo '<left> <form method="post" action="index.php">
<div class="form"> <center> <li align="center">Вход</li> <img src="img/user.png" width="20" height="20"> <div class="user"> <input type="text" name="e_login" required style="width:90px; border-radius:5px; vertical-align:middle;"><br> </div> <div class="img1"> <img src="img/key.png"> <div class="key"> <input type="password" name="e_password" required style="width:90px; border-radius:5px; vertical-align:middle;"><br> <div class="input"> <input type="submit" name="enter" value="OK" style="margin-left: 0px;"> <a href=""><li style="font-size: 15px;">Забыл пароль</li></a> </div>'; } if(isset($_POST['e_login']) and isset($_POST['e_password'])){ $_SESSION['name'] = $e_login; echo '<div style="width:150px; hieght:500px;margin-top:0px;padding:0px;"> <left> <li>Добро пожаловать,</li>'; echo $_SESSION['name']; //здесь такой стремный код, ибо иначе не выводит имя пользователя echo ' </left> <center> <li>Ваши данные</li> </center> <left> <li>игровых монет:</li> <li>алмазов:</li> </left> </div>'; } ?>