summaryrefslogtreecommitdiff
path: root/linkshorter/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'linkshorter/index.php')
-rw-r--r--linkshorter/index.php10
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>");
}