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

Put methods in an array instead of hardcoding them.

parent 6f087164
No related branches found
No related tags found
No related merge requests found
......@@ -45,12 +45,18 @@ if(isset($_POST['input']) && isset($_POST['type'])) {
<br>
<select class="form-control" name="type" id="type">
<option value="sha1">sha1</option>
<option value="sha256">sha256</option>
<option value="sha384">sha384</option>
<option value="sha512">sha512</option>
<option value="md2">md2</option>
<option value="md5">md5</option>
<?php
$methods = array(
"sha1", "sha256", "sha384", "sha512", "md2", "md5"
);
foreach($methods as $method) {
if(isset($_POST['type']) && $method == $_POST['type']) {
echo "<option value='$method' selected>$method</option>";
} else {
echo "<option value='$method'>$method</option>";
}
}
?>
</select>
<br>
......
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