From 39ca9d90ccb3e36512544a6432e2d19deef23fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20=C3=81lvarez?= Date: Thu, 18 Jul 2019 09:20:22 +0200 Subject: [PATCH] help and links --- README.md | 4 +++- index.php | 26 +++++++++++++++++++------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 0390e71..3c065a1 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ -Simpler than the mechanism of a spoon. \ No newline at end of file +Simpler than the mechanism of a spoon. + +Local testing: `php -S localhost:8000` \ No newline at end of file diff --git a/index.php b/index.php index 3b89c2e..c021f78 100644 --- a/index.php +++ b/index.php @@ -2,15 +2,14 @@ // action => label $buttons = [ - 'reset' => 'Reset', 'urlencode' => 'URL Encode', 'urldecode' => 'URL Decode', 'b64encode' => 'Base64 Encode', 'b64decode' => 'Base64 Decode', 'htmlencode' => 'HTML Encode', 'htmldecode' => 'HTML Decode', - // 'uuencode' => 'UU Encode', - // 'uudecode' => 'UU Decode', + 'uuencode' => 'UU Encode', + 'uudecode' => 'UU Decode', 'qprintencode' => 'Qprint Encode', 'qprintdecode' => 'Qprint Decode', 'hash' => 'Hash', @@ -19,6 +18,7 @@ $buttons = [ $str = $result = $_GET['str'] ?? ''; $action = $_GET['action'] ?? ''; +$help = 'manual/en/index.php'; if ($action == 'reset') { http_response_code(302); @@ -27,27 +27,35 @@ if ($action == 'reset') { } elseif ($action == 'urlencode') { $result = urlencode($str)?: $str; + $help = 'urlencode'; } elseif ($action == 'urldecode') { $result = urldecode($str)?: $str; + $help = 'urldecode'; } elseif ($action == 'b64encode') { $result = base64_encode($str)?: $str; + $help = 'base64_encode'; } elseif ($action == 'b64decode') { $result = base64_decode($str)?: $str; + $help = 'base64_decode'; } elseif ($action == 'htmlencode') { $result = htmlentities($str, ENT_QUOTES | ENT_HTML5)?: $str; + $help = 'htmlentities'; } elseif ($action == 'htmldecode') { $result = html_entity_decode($str, ENT_QUOTES | ENT_HTML5)?: $str; + $help = 'html_entity_decode'; } elseif ($action == 'uuencode') { $result = convert_uuencode($str)?: $str; + $help = 'convert_uuencode'; } elseif ($action == 'uudecode') { $result = convert_uudecode($str)?: $str; + $help = 'convert_uudecode'; } elseif ($action == 'hash') { $result = "Algorithm Time Len Hash\n"; @@ -58,15 +66,19 @@ if ($action == 'reset') { $result .= sprintf("%-15s %.3f %3d %s\n", $algo, $t2, strlen($r), $r); } $result = trim($result); + $help = 'hash'; } elseif ($action == 'hex') { $result = chunk_split(bin2hex($str), 2, " "); + $help = 'bin2hex'; } elseif ($action == 'qprintencode') { $result = quoted_printable_encode($str)?: $str; + $help = 'quoted_printable_encode'; } elseif ($action == 'qprintdecode') { $result = quoted_printable_decode($str)?: $str; + $help = 'quoted_printable_decode'; } ?> @@ -81,6 +93,7 @@ if ($action == 'reset') { + Encode/Decode everything @@ -91,10 +104,7 @@ if ($action == 'reset') { @@ -105,6 +115,8 @@ if ($action == 'reset') { $label) { ?> + Reset + Help
@@ -113,7 +125,7 @@ if ($action == 'reset') {
- Contact me via email or twitter. + Contact me via email or twitter. Made with pure PHP and Spectre. Code.