Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- index.php
- Всего: <?php echo (isset($_SESSION['amount']) ? $_SESSION['amount'] : 0); ?>
- <button onclick="location.href='add.php?amount=15'">добавить 15</button>
- <button onclick="location.href='add.php?amount=50'">добавить 50</button>
- ________________________________________________________________
- add.php
- <?php
- if (isset($_GET['amount'])) {
- session_start();
- $_SESSION['amount'] += (int) $_GET['amount'];
- }
- Header('Location: index.php');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement