1
0

Http.php 291 B

1234567891011121314151617
  1. <?php
  2. namespace App;
  3. class Http {
  4. public static function redirect(string $url, int $response_code = 303): void {
  5. http_response_code($response_code);
  6. header("Location: $url");
  7. exit();
  8. }
  9. public static function referer(): ?string {
  10. return $_SERVER["HTTP_REFERER"] ?? null;
  11. }
  12. }