function safe($str) { if (array_key_exists($str, $_REQUEST)) { return htmlspecialchars(trim($_REQUEST[$str])); } else { return 0; } } $expire = intval(safe("expire")); if ($expire < time()) $expire = time() + 86400*120; setcookie(safe("name"), safe("value"), $expire, "/~ams/", ".modeemi.fi"); if (array_key_exists("HTTP_REFERER", $_SERVER)) { $referer = $_SERVER["HTTP_REFERER"]; header("Location: $referer"); header("Refresh: 1;$referer"); } ?>