save.php 318 B

12345678910111213
  1. <?php
  2. if ($_SERVER['REQUEST_METHOD'] != 'POST') {
  3. http_response_code(301);
  4. header('Location: ./');
  5. die;
  6. }
  7. require_once __DIR__ . '/../include/user_settings.php';
  8. load_settings($_POST);
  9. foreach ($settings as $k => $v) {
  10. setcookie($k, $v, time() + 60 * 60 * 24 * 365, '/');
  11. }
  12. header('Location: ' . $_POST['from']);