summaryrefslogtreecommitdiff
path: root/linkshorter/goto.php
diff options
context:
space:
mode:
Diffstat (limited to 'linkshorter/goto.php')
-rw-r--r--linkshorter/goto.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/linkshorter/goto.php b/linkshorter/goto.php
new file mode 100644
index 0000000..d77e1e2
--- /dev/null
+++ b/linkshorter/goto.php
@@ -0,0 +1,13 @@
+<?php
+require 'functions.php';
+ob_start("sanitize_output");
+require 'db.php';
+
+$url = $db->get($_GET["goto"]);
+if( ! $url || $url == "" ){
+ do_output("<p>This url wasn't found on this server.</p>", "404 Not Found", false, "<h1>404 - Not found</h1>");
+}
+
+header($_SERVER['SERVER_PROTOCOL'] . " 301 Moved Permanently");
+header("Location: ".$url);
+exit;