CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 empty password field during update

Print topic Send  topic

Author Message
Tomasz
Posted: 02/06/2002, 10:19 AM

I encrypt passwords in db.
On the form for changing user data, there's textbox field for entering new password. Becouse I want it to be initially empty, there's $fldpass =""; in before show event.
In before update event there's code for encrypting new value:

if ($fldpass != "")
{ $fldpass = md5($fldpass); }

but this also means, that if user don't eneter anything in this box, form is updated with empty pass field value (null password is stored in db). Of course I would like the form to leave old password.. And I don't want to make sql query for retrieving old value from db before update..

Does anybody has any idea?..
Ken Hardwick
Posted: 02/06/2002, 11:02 AM

On your form. Bring in your field as a "hidden" field.
Then add an addition text box,without a field listed, for the user to indicated new password.

Then in the "before update" event, check to see if there was an "valid" entry in the text box, if so, set the Password field equal to it, else leave the password field as it originally was.

In ASP this would be like following..
Field = Password
Text Box = NewPassword

In the before Update event..

If fldNewPassword <> "" then
fldPassword = fldNewPassword
end if

'then encrypt in what ever method you would use..like a function..
fldPassword = Encrypt(fldPassword)

Ken Hardwick
Norman,Ok


Tomasz
Posted: 02/06/2002, 12:21 PM

Thanks, Ken

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.