The area of authorization is not removed after the very authorization.



  • I checked for the authorisation, and if the user has authorised, write "Welcome, ***," "You've got... play coins." But after the POST data transmission, the fields are not vanishing, and the greetings come under the block with the fields. Tell me how to do that instead of the authorization block, the welcoming block and such information. Here's 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>'; } ?>



  • You need to reschedule the POST check. if(isset($_POST['e_login'])... before checking the existence of a variable session if(!isset($_SESSION['name']))


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2