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 --- header/index.php | 18 +++++++++-------- index.php | 6 +++--- linkshorter/functions.php | 3 ++- linkshorter/index.html | 50 ----------------------------------------------- linkshorter/index.php | 18 +++++++++++------ tools/footer.php | 18 +++++++++++++++++ tools/navbar.php | 7 +++++-- tools/style.css | 8 ++++++++ 8 files changed, 58 insertions(+), 70 deletions(-) delete mode 100644 linkshorter/index.html diff --git a/header/index.php b/header/index.php index 1a027ab..a41912a 100644 --- a/header/index.php +++ b/header/index.php @@ -38,7 +38,7 @@ if ( $set ){ $redis->ping(); $redis->select(9); - $key = md5( $url . serialize($customHeader) ); + $key = md5( $url . $method . serialize($customHeader) ); if( $redis->exists( $key ) ){ return unserialize( $redis->get( $key ) ); @@ -81,7 +81,7 @@ if ( $set ){ return $result; } - if ( ! isset($_REQUEST['method']) || $_REQUEST['method'] != "" ){ + if ( ! isset($_REQUEST['method']) || $_REQUEST['method'] == "" ){ $_REQUEST['method'] = 'get'; } else { $_REQUEST['method'] = strtolower($_REQUEST['method']); @@ -112,13 +112,13 @@ Host: "" -

Retrieve HTTP Headers Online!

-

Check the response headers for websites.
Enter a URL and hit the submit button.

-
- + +

Retrieve HTTP Headers Online!

+

Check the response headers for websites.

+
@@ -132,8 +132,9 @@ Host: ""
- +
+
+
@@ -162,7 +164,7 @@ Host: "" - Add any header, which are sent to the server. + Add additional header, which are sent with the request. diff --git a/index.php b/index.php index 99a8458..7996b07 100644 --- a/index.php +++ b/index.php @@ -5,7 +5,7 @@ @@ -18,7 +18,7 @@ - +
@@ -27,4 +27,4 @@
- + 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

"); } diff --git a/tools/footer.php b/tools/footer.php index 9bc6c55..fedea9f 100644 --- a/tools/footer.php +++ b/tools/footer.php @@ -7,3 +7,21 @@
+ diff --git a/tools/navbar.php b/tools/navbar.php index b676fa2..1efa262 100644 --- a/tools/navbar.php +++ b/tools/navbar.php @@ -9,8 +9,11 @@ diff --git a/tools/style.css b/tools/style.css index c42a75b..02249d3 100644 --- a/tools/style.css +++ b/tools/style.css @@ -31,6 +31,10 @@ a { color: white; } +.noscript { + background-color: #dd5148; + color: white; +} /* footer */ @@ -52,3 +56,7 @@ a { color: white; text-decoration: underline; } + +.underline { + text-decoration: underline; +} -- cgit v1.2.3