Skip to content

Commit

Permalink
Update uri.php
Browse files Browse the repository at this point in the history
  • Loading branch information
gnh1201 authored Oct 27, 2021
1 parent f2a4ec3 commit e3044d0
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion system/uri.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,26 @@ function redirect_uri($uri, $permanent=false, $options=array()) {
show_errors();
}
}

if(array_key_equals("method", $options, "html")) {
echo <<<EOF
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="1;url=$uri">
<title>Redirect</title>
</head>
<body>
<a id="goto" href="$uri">Go to the page</a>
<script>window.onload = function() { document.getElementById("goto").click(); };</script>
</body>
</html>
EOF;
} else {
header("Location: " . $uri, true, $permanent ? 301 : 302);
}

header("Location: " . $uri, true, $permanent ? 301 : 302);
exit();
}
}
Expand Down

0 comments on commit e3044d0

Please sign in to comment.