How to encrypt the passwords and other important information using php md5

How to encrypt the passwords and other important information in your site say cookies,password, etc…well it is very simple md5 them so that nobody will be able to read it. here is a small example to md5 the words.
see the example at:
http://members.lycos.co.uk/nharsha/index.php

<html>
<head>
<!--coded by harsha email:[email protected]>
<title>php and its md5 function</title>
<?php
/*if statement verifies the form input*/
if($HTTP_POST_VARS)<span id="more-663"></span>
{
$code= md5($pass);
/*note that these htmlspecialchars and md5 are the built in functons of php language*/
echo "the word you have entered is:\t\t\t".$pass."<br />";
echo "the md5ied form of the word is:\t\t\t".$code;
}
//end of if statement
?>
</head>
<body>
<form method="post" action="<?=$PHP_SELF?>">
<br />
<b>enter a word:</b><br /><input type="text" name="pass"><br />
<input type="submit" value="md5">
</form>
</body>
</html>

Tags:, ,

Leave a Reply