Open formandprocess.php and save it as phpencryption.php.  Delete the surname and dob fields (and labels) leaving just one field in the form.  Also delete two of the three variable lines inside the else as they are not needed any more.  Delete both echo lines.

Now add these lines under the variable line:

$encryptedFirstname=hash("sha256", $firstvalue);
$query="INSERT INTO `encryption` (`firstname`, `sha`) VALUES ('$firstvalue', '$encryptedFirstname');";
		
echo $query;

Try the page by typing a name.  The first new line encrypts the name and stores it in a variable.  The second creates a query to store the two values (unencrypted name and encrypted name).  At the moment the query is just shown on the page as text but you could create a table and store it.  The encrypted version is 256 bits of data represented as hexadecimal.  No need to worry what that means if you do not know.  The point is that the text will always be 64 characters long when encrypted regardless of how long it was to start with.

Try various names and the encryption will give a different result.  Try the same name twice and the end result is the same.