Skip to content
Snippets Groups Projects
Commit 4b347ed4 authored by Zandor Smith's avatar Zandor Smith :computer:
Browse files

Main functionality + some styling.

parent 1d1f2855
No related branches found
No related tags found
No related merge requests found
<?php
$hash = null;
if(isset($_POST)) {
// Do hash
$input = $_POST['input'];
$type = strtolower($_POST['type']);
if($type == "sha1") {
$hash = sha1($input);
} else if($type == "sha256") {
$hash = hash('sha256', $input);
} else if($type == "md5") {
$hash = md5($input);
} else {
$hash = "Not-supported hashing method selected";
}
}
?>
......@@ -24,10 +35,17 @@ if(isset($_POST)) {
<h1>Hash Online</h1>
<h5 class="text-muted">Hash SHA1, SHA256, MD5 and more online</h5>
<form action="/" >
<form method="post" action="/" class="mt-5">
<input type="text" class="form-control" name="input" id="input" placeholder="Your input">
<label for="type">Hashing method</label>
<select class="form-control" name="type" id="type">
<option value="SHA1">SHA1</option>
<option value="SHA256">SHA256</option>
<option value="MD5">MD5</option>
</select>
</form>
<?php
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment