PDA

View Full Version : Md5 Encryption...


Jasonb61
08-26-2002, 11:08 PM
Can someone help me? It wont encrypt the she string I want it to encrypt when a button is clicked....


echo "<center><font size=2 face=\"Verdana\">Enter Login Information</center></font><br>";
echo "<center><input type=text name=\"UseRx\"><br></center>";
echo "<center><input type=password name=\"PasSx\"><br></center>";
echo "<center><input type=button value=\"Login\" Onclick='location.href=\"admin?USER=\"+UseRx.value+\"&PASS=\"+md5(PasSx.value);'></center>";


Please Help!

stuntboy
08-27-2002, 12:50 AM
the problem is you are encrypting at the wrong time. when that particular part you have to get it AFTER the form has submitted.

so you will be running

<?php
if(!isset($_POST['UseRx'])&&!isset($_POST['PasSx'])){
?>
<form method="post" action="<?=$_SERVER['PHP_SELF'];?">
<input type=text name="UseRx"><br>
<input type=password name="PasSx"><br>
<input type="submit" value="submit">
</form>
<?php
}
esle
echo md5($_POST['PasSx']));
?>