<?php
session_start();
$slogin_noauthpage = 1;
$slogin_pagetitle = "Encrypted password generator.";
include_once ("slogin_lib.inc.php");
include_once ("header.inc.php");


if ($_POST["slogin_POST_plainpass"]) {
  $slogin_plainpass = substr (trim (ereg_replace("[^[:alnum:]_.]", "",$_POST["slogin_POST_plainpass"])), 0, 120);
  $slogin_hashedpass = md5 ($slogin_plainpass);
}
else {
  $slogin_plainpass = "";
  $slogin_hashedpass = "";
}


echo "<form method=\"post\" action=\"$slogin_php_self\">";
echo "{$slogin_text[$slogin_lang]["EnterPlain"]}<br>";
echo "<input type=\"text\" name=\"slogin_POST_plainpass\" value=\"$slogin_plainpass\"><br>";
echo "<input type=\"submit\" name=\"slogin_POST_sendgen\" value=\"{$slogin_text[$slogin_lang]["HashButton"]}\">";
echo "</form>";
if ($slogin_hashedpass) {
  echo "<p>{$slogin_text[$slogin_lang]["Password"]} $slogin_hashedpass</p>";
}

include_once ("footer.inc.php"); ?>