Created
April 3, 2019 09:53
-
-
Save anton21m/8b3c32947c188e348e00d0f27692f7f2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php session_start(); ?> | |
<?php echo $_SESSION['token'] .' YY '. $_POST['token'].'<br>'; | |
if ($_SERVER['REQUEST_METHOD'] == 'POST' | |
&& $_SESSION['token'] == $_POST['token']){ | |
echo '<script>alert("Успех");</script>'; | |
} ?> | |
<?php $_SESSION['token'] = md5(time()); ?> | |
<form name="form" method="post" action="test.php"> | |
<input type="text" name="den"> | |
<input type="hidden" name="token" value="<?= $_SESSION['token'] ?>"> | |
<input type="submit" > | |
<?php echo $_SESSION['token']; ?> | |
</form> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment