Hello to all. I do not know what kind of attack. Wrote a fragment of this type allows you to change the shape depending on the presence of the user. I reviewed a bunch of examples on the network, and everywhere this composition works for everyone. I have the same problem, it works either input or output, depending on the condition. Although everything else works, and displaying a separate button on "logout.php" session closes without problems, but the form remains fixed. Where am I wrong?
<form action="login.php" method="post"><center> <?php if($_SESSION['status']!="login") { ?> <label>Логин:</label><br> <input type="text" name="login" placeholder="Login"></input><br> <label>Пароль:</label><br> <input type="password" name="password" placeholder="Password"></input><br> <input type="submit" name="submit" value="Enter"><br> <button formaction="registration.php">Регистрация</button></center> <?php } else if ($_SESSION['status']=="login") { ?> <label>Добро пожаловать,<? echo " ".$_SESSION['name']." ".$_SESSION['surname']."!" ?> </label> <button formaction=logout.php>Выход</button> <?php } ?> </form>
if ($_SESSION['status']=="login").http://www.w3schools.com/tags/att_input_formaction.aspNot all browsers workformaction!. - E_pcenterdoes not always close, but only when there is no session - E_p