Hi, im trying this and it doesnt seem to work. I know it must be an innocent newbie error. $pass = wupi $key = hash('SHA256', '$pass'); PHP: It seems the result is always the same and the hash function assumes the text to hash is $pass instead of "wupi" or what I ever i pass to that variable.
Please excuse me, my original code had the quotes and ; on the end. I just edited when I posted the reply in the forum. Here is actually how im trying to pass it: $pass = $_GET["password"]; echo $pass; $key = hash('SHA256', '$pass'); The echo line 2 is just for testing. That is not needed. I want to change the key on the fly with a get command but the generated output is alwas the same. I also tried putting the get directly on the hash or converting and several other ways but it doesn't seem to work.
Why did you put the $pass variable between single quotes? You should use double quotes, better yet forget the quotes and use the variable as is. Now it should generate the hash of the value instead of the string '$pass'. $key = hash('SHA256', $pass); PHP: