Can anyone help me understand why I can't straight compare two md5 hashes in my code but am able to compare them if I grab one of the hashes from a get string or a db query?
It seems to have something to do with at least one of the hashes already created???
For example, if I have something like:
$magic_string = "GoGOgO";
$first_name = "Mike";
$second_name = "Mike";
$first_hash = md5("$first_name$magic_string");
$second_hash = md5("$second_name$magic_string");
if ($first_hash==$second_has) {
echo "true";
} else {
echo "false";
}
When I try to perform a simple IF statement, it always evaluates false:
HOWEVER, if I grab either of the hashes from a get string, post string or db query, then it will evaluate true when the hashes are identical.
What's the error in the way I'm looking at this?
Thanks.