Location: PHPKode > scripts > Encrypt MD5 64 > encrypt-md5-64/example3.php
<?
include("encdec.php");

$enc = new encdec();
$data=$HTTP_POST_VARS['data'];
$dec=$HTTP_POST_VARS['decryption'];
$key=$HTTP_POST_VARS['pwd'];
$e='';
if ($dec=='fals')
{
	$e = $enc->encrypt($data,$key);
	echo '<h2> Result= '.urldecode($e).'</h2><br/><br/>';
}
else
{
	$d = $enc->decrypt($dec,$key);
	echo '<h2> Result= '.urldecode($d).'</h2><br/><br/>';
}
?>
<html>
	<head>
		<title>Encryption</title>
	</head>
	<body>

		<h2>Encryption</h2><br/>

		<form method="post" action="example3.php">
		<input type="hidden" name="decryption" value="fals"/>
			<input type="text" name="data" value="www.stekpi.ac.id"/>&nbsp;&nbsp;Data
			<br/>
			<input type="text" name="pwd" value="agus"/>&nbsp;&nbsp;Key
			<br/>
			<input type="submit" value="Encrypt">
		</form>

		<br/><br/>

		<h2>Decryption</h2><br/>

		<form method="post" action="example3.php">
		<input type="hidden" name="data" value="fals"/>
			<input type="text" name="decryption" value="<?=urldecode($e);?>"/>&nbsp;&nbsp;Data
			<br/>
			<input type="text" name="pwd" value="<?=$key;?>"/>&nbsp;&nbsp;Key
			<br/>
			<input type="submit" value="Decrypt">
		</form>
	</body>
</html>
Return current item: Encrypt MD5 64