Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- if (!isset($_SESSION['errors'])) {
- $_SESSION['errors'] = array();
- }
- if (isset($_REQUEST['action'])) {
- $_SESSION['errors'][] = 'Ошибка!!';
- header('Location: ?');
- exit();
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title></title>
- </head>
- <body>
- <form action="?action=test" method="POST">
- <input type="text" value="12"/><input type="submit" value="hello"/>
- </form>
- <?php
- echo('<p>+'.count($_SESSION['errors']));
- if (count($_SESSION['errors']) != 0) {
- echo('<p>-'.count($_SESSION['errors']));
- $_SESSION['errors'] = array();
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement