diff options
| author | root | 2014-11-27 15:55:25 +0100 |
|---|---|---|
| committer | root | 2014-11-27 15:55:25 +0100 |
| commit | 4f923b809b4e38e0639e253f428fb6c4df03ee67 (patch) | |
| tree | 20d9d9ad9dae0316dad27358b4239b6f18f80e87 /linkshorter/index.php | |
| parent | 311ad398e06cd2eba270ea70ca5a326d03b490f9 (diff) | |
| download | tools.iamfabulous.de-4f923b809b4e38e0639e253f428fb6c4df03ee67.tar.gz | |
More structured + better UI
Diffstat (limited to 'linkshorter/index.php')
| -rw-r--r-- | linkshorter/index.php | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/linkshorter/index.php b/linkshorter/index.php index cca4f20..8d05977 100644 --- a/linkshorter/index.php +++ b/linkshorter/index.php @@ -1,18 +1,18 @@ <?php require 'functions.php'; require 'config.php'; -require 'class/db.php'; +require '../tools/class/redis.php'; if ( ! isset($_REQUEST['url']) || $_REQUEST['url'] == "" ){ -if ( ! isset($_REQUEST['checkpassword']) || $_REQUEST['checkpassword'] != 1 ) + if ( ! isset($_REQUEST['checkpassword']) || $_REQUEST['checkpassword'] != 1 ) require 'view/templ-index.php'; else { if ( ! isset($_REQUEST["short"]) || $_REQUEST["short"] == "" ){ - header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found"); - _do_output("Failure!", "Requested ID not found."); + require 'view/templ-notfound.php'; + exit; } $db = new Database(REDIS_CONNECT, REDIS_SELECT); @@ -73,5 +73,5 @@ if ( ! isset($_REQUEST['checkpassword']) || $_REQUEST['checkpassword'] != 1 ) } } - _do_output("Success!", "Your short link is " . SHORTDOMAIN . htmlentities($options["short"]) . "."); + _do_output("Success!", "Your short link is <a href=\"" . SHORTDOMAIN . htmlentities($options["short"]) . "\" title=\"".htmlentities($options["url"])."\">". SHORTDOMAIN . htmlentities($options["short"]) ."</a>"); } |
