summaryrefslogtreecommitdiff
path: root/linkshorter/goto.php
diff options
context:
space:
mode:
authorHorus32014-11-16 21:20:41 +0100
committerHorus32014-11-16 21:20:41 +0100
commit4168f7aff52f6e7cf7320e42252227dac5169c4a (patch)
treef73e5e93e8bc8d9b5ad8ef415b59ede323663f76 /linkshorter/goto.php
downloadtools.iamfabulous.de-4168f7aff52f6e7cf7320e42252227dac5169c4a.tar.gz
Initial commit.
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;