Page 1 of 1
dbts form processor
Posted: Tue Apr 25, 2017 2:44 pm
by maxime
how can i create a password field and make it save with md5 (encrypt) using the DBTS form processor
Re: dbts form processor
Posted: Tue Apr 25, 2017 2:57 pm
by Navaldesign
You will need to use the "Custom processing" properties, to add the necessary code to MD5 encrypt a given field value.
Re: dbts form processor
Posted: Tue Apr 25, 2017 3:52 pm
by maxime
yes i know i have already be able to make the | as a separator by putting a special code using the before error section
but i do not know what code to use for making a password in md5 and in wich section exactly of the custom processing !. what about the name of the field should i use ?
Re: dbts form processor
Posted: Tue Apr 25, 2017 6:20 pm
by Navaldesign
Use (just an example) a field in the form named "pass".
Then use the following code (haven't tested it):
$_POST["password"] = md5($_POST["pass"]);
in the "Start of Script Custom Processing" section.
This will create a "password" value equal to the md5 of "pass".
Also, it will add it in the $_POST superglobal JUST AS if it had been submitted directly from the form.
If you wish to destroy the "pass" value so it will not be stored in the database in clear (non encrypted) format, for security reasons, you should add a second line of code as follows:
$_POST["password"] = md5($_POST["pass"]);
unset ($_POST["pass"]);
Re: dbts form processor
Posted: Tue Apr 25, 2017 10:42 pm
by maxime
yessssssssssssssss, Thank you Naval, it work very well !