Andreu | 0d72bd6 | 2019-09-17 23:31:14 +0200 | [diff] [blame] | 1 | <?php |
Andreu | abbcb7e | 2019-09-21 18:22:14 +0200 | [diff] [blame] | 2 | require 'utils.php'; |
Andreu | efe66eb | 2019-09-21 18:41:49 +0200 | [diff] [blame] | 3 | |
Andreu | 09b8b05 | 2019-09-21 21:47:20 +0200 | [diff] [blame^] | 4 | // Set the 'user' POST and COOKIE variable |
| 5 | if (isset($_POST['user'])) { |
| 6 | setcookie('user', $_POST['user'], time() + (86400 * 10), "/"); |
| 7 | } else if (isset($_COOKIE['user']) && !isset($_POST['user'])) { |
| 8 | $_POST['user'] = $_COOKIE['user']; |
| 9 | } else if (!isset($_COOKIE['user']) && !isset($_POST['user'])) { |
| 10 | header("Location: ./index.php"); |
| 11 | die(); |
| 12 | } |
| 13 | |
| 14 | header("Location: ../main.php"); |
Andreu | 0d72bd6 | 2019-09-17 23:31:14 +0200 | [diff] [blame] | 15 | ?> |