Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/http.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-06-06 16:13:24 +0200
committerErich Eckner <git@eckner.net>2019-06-06 16:13:24 +0200
commitdd342d1d9863834d9aba120b4a78d2ac959e33f7 (patch)
treed332a0f4ab28af662957f730e6b32882deb8220c /lib/http.php
parentac15e6b8340039ae68d86f02ca1cd2d68dcf42d0 (diff)
lib/http.php: redirect_temporarily($uri) new
Diffstat (limited to 'lib/http.php')
-rw-r--r--lib/http.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/http.php b/lib/http.php
index 9b63337..0647802 100644
--- a/lib/http.php
+++ b/lib/http.php
@@ -15,3 +15,16 @@ function throw_http_error($error_number, $error_message, $extra_message = "") {
function die_500($message) {
throw_http_error(500, "Internal Server Error", $message);
};
+
+function redirect_temporarily($uri) {
+ header("Location: " . $uri);
+ print "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n";
+ print "<html><head>\n";
+ print "<title>302 Found</title>\n";
+ print "</head><body>\n";
+ print "<h1>Found</h1>\n";
+ print "<p>The document has moved <a href=\"" . $uri . "\">here</a>.</p>\n";
+ print "<hr>\n";
+ print "</body></html>\n";
+ die();
+};