From f7755964e8703d66cee123a18519a07d49df0ae0 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 17 Nov 2014 01:42:48 +0100 Subject: modified for use case --- linkshorter/functions.php | 3 ++- linkshorter/index.html | 50 ----------------------------------------------- linkshorter/index.php | 18 +++++++++++------ 3 files changed, 14 insertions(+), 57 deletions(-) delete mode 100644 linkshorter/index.html (limited to 'linkshorter') diff --git a/linkshorter/functions.php b/linkshorter/functions.php index f6f021a..7fa8cff 100644 --- a/linkshorter/functions.php +++ b/linkshorter/functions.php @@ -13,11 +13,12 @@ function do_output($reason, $httpcode, $ajax = true, $heading = NULL){ Link Shorter + - + diff --git a/linkshorter/index.html b/linkshorter/index.html deleted file mode 100644 index 62ff295..0000000 --- a/linkshorter/index.html +++ /dev/null @@ -1,50 +0,0 @@ - - - - -Link Shorter - - - - - - -
-
-
-
-
-

Amazing Linkshorter

-
- -
- -
-
-
- -
- -
-
-
-
-
-
-
- - diff --git a/linkshorter/index.php b/linkshorter/index.php index 75ac9aa..1d56be5 100644 --- a/linkshorter/index.php +++ b/linkshorter/index.php @@ -2,10 +2,12 @@ require 'functions.php'; require 'db.php'; -ob_start("sanitize_output"); +//ob_start("sanitize_output"); +ob_start(); if ( $_SERVER['REQUEST_METHOD'] != 'POST'){ +/* $key = "lscache_" . md5( strtolower($_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"].$_SERVER["QUERY_STRING"])); if ( $db->exists($key) ) { header("X-Cache: Hit"); @@ -13,6 +15,7 @@ if ( $_SERVER['REQUEST_METHOD'] != 'POST'){ ob_end_flush(); exit; } +*/ ?> @@ -20,11 +23,12 @@ if ( $_SERVER['REQUEST_METHOD'] != 'POST'){ Link Shorter - + + - + @@ -35,7 +39,9 @@ if ( $_SERVER['REQUEST_METHOD'] != 'POST'){
-

Amazing Linkshorter

+

Amazing Linkshorter

+

Short your link and use a easy to remembery query string

+
@@ -56,7 +62,7 @@ if ( $_SERVER['REQUEST_METHOD'] != 'POST'){
- +
@@ -104,5 +110,5 @@ if ( $_SERVER['REQUEST_METHOD'] != 'POST'){ } $db->set($short, $_POST["url"]); - do_output("

Your short link for ".htmlentities($_POST["url"])." is
http://".$_SERVER["HTTP_HOST"]."/".$short."

", "200 OK", false, "

Success

"); + do_output("

Your short link for ".htmlentities($_POST["url"])." is
http://s.moehm.org/".$short."

", "200 OK", false, "

Success

"); } -- cgit v1.2.3