diff --git a/index.php b/index.php index 3dce518..fb15d80 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,5 @@ - + @@ -7,13 +7,13 @@ - +

SlankLink

-

- +

+

@@ -48,14 +48,14 @@ // validate & adjust url if (stristr($url, '://') === FALSE) $url = 'http://' . $url; -echo "

target url: {$url}

\n"; +echo "

target url: {$url}

\n"; $id = rand(0, 60466175); $ids = base_convert($id, 10, 36); if (file_exists($ids)) { - echo '

ERROR: collision. try again.

'; - echo "

orig id: {$id}
\n"; + echo '

ERROR: collision. try again.

'; + echo "

orig id: {$id}
\n"; echo "encd id: {$ids}

\n"; goto SKIP; } @@ -71,7 +71,7 @@ if (isset($_SERVER['SERVER_PORT']) && (intval($_SERVER['SERVER_PORT']) != 80)) $selfaddr_root .= ':' . $_SERVER['SERVER_PORT']; $selfaddr_root .= dirname($_SERVER['REQUEST_URI']); -echo "

short url: {$selfaddr_root}{$ids}

"; +echo "

short url: {$selfaddr_root}{$ids}

"; SKIP: ?> diff --git a/slanklink.css b/slanklink.css new file mode 100644 index 0000000..667ea5b --- /dev/null +++ b/slanklink.css @@ -0,0 +1,34 @@ +html { + background-color: #fff; +} + +body { + font-family: sans; + font-size: 1.2em; + text-align: center; +} + +h1 { + margin: 1.7em auto; + font-weight: normal; + font-size: 2em; + color: #333; +} + +p.error { + background-color: #f66; + font-weight: bold; + padding: 0.5em; +} + +p.debug { + color: #777; +} + +input.urlentry { + width: 50em; +} + +span.grey { + color: #777; +}