I'm pulling a password from a database, which was encrypted with MD5. So, my $pass is the variable with MD5 password string.
I'm trying to do a simple, popup alert to check the password to show a hidden DIV. But, I'm not too familiar with MD5 and I know that javascript does not have that function, so I tried converting it to PHP. It doesn't work, so I wanted to get some help on getting it fixed (if possible) or approaching it from a different perspective. The problem is I still have to deal with MD5.
Thanks, a lot for any help.Code:<?php echo "<script type=\"text/javascript\">"; echo "function rdfShow(obj){"; echo "var ".$popup." = prompt(\"What's the password?\", \"\");"; $hash = md5($_GET["popup"]); echo "if(\"".$hash."\" === \"".$pass."\")"; echo "document.getElementById(obj).style.display = 'block';"; echo "else"; echo "alert('Wrong password!');"; echo "}"; echo "</script>"; ?>



Reply With Quote

Bookmarks