"Have I added this code wrong, or should it be updated?"
no way to tell given the information you have provided.
How did you add this code?
what is the name of the password form element on the page? if it is not "UserPassword" the code for the post will need to be changed accordingly
what is the name of the recordset that populates the page? if it is not WADAusers, the code will need to be adjusted accordingly.
what is the name of the password column in the database" if it is not "UserPassword" the code will need to be adjusted accordingly
<?php echo ((($_POST["FormElementName"] != ""))?WA_MD5Encryption($_POST["FormElementName"]):$row_RecordsetName["PasswordColumnName"]); ?>