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/view | |
| parent | 311ad398e06cd2eba270ea70ca5a326d03b490f9 (diff) | |
| download | tools.iamfabulous.de-4f923b809b4e38e0639e253f428fb6c4df03ee67.tar.gz | |
More structured + better UI
Diffstat (limited to 'linkshorter/view')
| -rw-r--r-- | linkshorter/view/templ-head.php | 5 | ||||
| -rw-r--r-- | linkshorter/view/templ-index.php | 17 | ||||
| -rw-r--r-- | linkshorter/view/templ-notfound.php | 14 |
3 files changed, 30 insertions, 6 deletions
diff --git a/linkshorter/view/templ-head.php b/linkshorter/view/templ-head.php index 2eee43c..4dd76d5 100644 --- a/linkshorter/view/templ-head.php +++ b/linkshorter/view/templ-head.php @@ -1,3 +1,6 @@ +<?php + require '../tools/config.php'; +?> <!doctype html> <html> <head> @@ -9,7 +12,7 @@ <?php echo file_get_contents("../tools/style.css"); ?> .grey { color: #737373;} </style> - <link rel='shortcut icon' href='../tools/favicon.ico' type='image/x-icon'> + <link rel='shortcut icon' href='<?php echo __domain_; ?>/tools/favicon.ico' type='image/x-icon'> <meta name="viewport" content="width=device-width, initial-scale=1.0"> </head> <?php require("../tools/navbar.php"); ?> diff --git a/linkshorter/view/templ-index.php b/linkshorter/view/templ-index.php index 17b042e..46ff6a8 100644 --- a/linkshorter/view/templ-index.php +++ b/linkshorter/view/templ-index.php @@ -1,6 +1,9 @@ <?php $title= "Link Shorter"; require 'view/templ-head.php'; + + if ( $_scheme . $_SERVER["HTTP_HOST"] != __domain_ ) + redirect(__domain_ . "/linkshorter/"); ?> <div class="container"> <div class="text-center"> @@ -13,27 +16,31 @@ <div class="form-group"> <label class="col-md-4 control-label" for="url">Link:</label> <div class="col-md-5"> - <input id="url" name="url" placeholder="http://www.moehm.org/" class="form-control input-md" required="" type="text"> + <input id="url" name="url" placeholder="Enter a URL to shorten..." class="form-control input-md" required="" type="text"> </div> </div> <div class="form-group"> - <label class="col-md-4 control-label grey" for="short">(optional)</label> + <h4>Options:</h4> + </div> + + <div class="form-group"> + <label class="col-md-4 control-label grey" for="short">Query String</label> <div class="col-md-4"> - <input id="short" name="short" placeholder="Your own query string here." class="form-control input-md" type="text"> + <input id="short" name="short" placeholder="Your own query string here. (optional)" class="form-control input-md" type="text"> </div> </div> <!-- Password input--> <div class="form-group"> - <label class="col-md-4 control-label grey" for="password">(optional)</label> + <label class="col-md-4 control-label grey" for="password">Password</label> <div class="col-md-4"> <input id="password" name="password" placeholder="Protect your link with a password." class="form-control input-md" type="password"> </div> </div> <div class="form-group"> - <label class="col-md-4 control-label grey" for="ttl">(optional)</label> + <label class="col-md-4 control-label grey" for="ttl">Expires</label> <div class="col-md-4"> <input id="ttl" name="ttl" class="form-control input-md" type="number" min="0"> <span class="help-block text-left">Choose how long the shortlink should be valid. (In seconds)</span> diff --git a/linkshorter/view/templ-notfound.php b/linkshorter/view/templ-notfound.php new file mode 100644 index 0000000..66d654b --- /dev/null +++ b/linkshorter/view/templ-notfound.php @@ -0,0 +1,14 @@ +<?php + header($_SERVER["SERVER_PROTOCOL"] . " 404 Not Found"); + header("X-Request-Id: " . $_REQUEST["short"]); + $title= "404 Not Found"; + require 'view/templ-head.php'; +?> +<div class="container text-center pagination-centered"> + <div class="row"> + <h1>Failure - Not Found</h1> + <hr> + <h4>The requested URL ('<?php echo htmlentities($_SERVER["REQUEST_URI"]); ?>') wasn't found on this server.</h4> + </div> +</div> + <?php require("../tools/footer.php"); ?> |
