close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

SHA1 encrypt password field

Thread began 12/18/2011 4:11 pm by steelace396915 | Last modified 12/19/2011 9:55 am by Ian S | 2713 views | 5 replies |

steelace396915

SHA1 encrypt password field

Hi

I have a quick question and probably a very easy one to answer! I have a wizard generated set of pages made in DataAssist. Everything works well but one thing! I've tried to set the password field in the insert records behaviour to be encrypted to SHA1 when written to database! I followed the guides available and I can't understand what is wrong. I can insert all fileds in the form correctly as long as I don't choose any encryption. I know how to encrypt the data when it's written to the MySQL database from PHPmyadmin but I want it to happen automatically on insert! Could someone please tell me what code has to go in the insert record server behaviour for this to happen!??

I've tried the following in the insert record behaviour for the password form field:

<?php echo WA_SHA1Encryption(((isset($_POST["UserPassword"]))?$_POST["UserPassword"]:"")) ?> (Does not work for me)

From the start the code is like follows and then the data is inserted correctly in database but not encrypted:

<?php echo ((isset($_POST["UserPassword"]))?$_POST["UserPassword"]:""); ?> (This works with no encryption)


/Martin J.

PS I have a 100 varchar field in database for the password so that's not the problem.

Sign in to reply to this post

Ian S

Using the DA Insert record behaviour, click the lightening bolt to select the form field that you want to save against the field. Select your form field for password and before your press OK change the Format to Encryption - SHA1.

Your field for insertion should them show something like:

<?php echo WA_SHA1Encryption(((isset($_POST["pwd"]))?$_POST["pwd"]:"")) ?>

Where pwd is the name of your password text field on the form.

Cheers
Ian

Sign in to reply to this post

steelace396915

Solved

Thanks Ian! You responded so fast I didnt even see it! :=)

Hey I worked it out! I used the insert record behaviour under meny dataassist which seemed logical to me! It turned out I should have used the single insert behaviour under webassist/dataassist! Now it works. This is very confusing I must say and should really be reworked for easier understanding? Just a suggestion! Otherwise I love your extensions but maybe they could be even more intuitive? Most of us using them are designers and no programmers! :=)

Sign in to reply to this post

Ian S

Hi,

It shouldn't make any difference which Insert record you use.

The one under Data Assist is the actual DataAssist release (2.08 is the latest version). The Data Assist behaviours that appear under the WebAssist menu are installed as part of another extension.

Cheers
Ian

Sign in to reply to this post

steelace396915

SHA1 Encrypt Password in Insert Form

Ian, just for yours and others information, it does differ. At least when I'm trying both. I've tried the insert record behaviour under dataassist menu from insert panel many times and it does not work. Then by coincident I tried the behaviour alternative under webassist/dataassist in insert panel and then it worked!? I made exactly the same moves each time. The dialogs look different though. I don't know why but I did get it to work!

1. Create all pages from DataAssist wizard.

2. On the insertpage, remove the insert record behaviour created from wizard and then add the insert record behaviour located in insert panel /webassist/dataassist/insert/insert single record

3. Open the new insert record behaviour from the Behaviours panel and click "bindings" tab when opened. Click the password field in list for which you want to apply encryption. Click the value dynamic button. Choose the password form field from the WADAInsertForm in list. In list "Format" choose your encryption choice (Ex: Encryption - SHA1)

Voala! Now it works!

Regards,
Martin J.

Sign in to reply to this post

Ian S

Hi Martin,

Good to hear you got it working.

It works for me using the Data Assist option - which I stick to for now because using the other option, for me, would mean having two sets of DA Includes on the server.

Cheers
Ian

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...