CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 How to validate current password before updating with new password.

Print topic Send  topic

Author Message
jim7567g

Posts: 38
Posted: 01/16/2005, 11:37 AM

I would like to know if anyone could share the code needed to validate a current password field before updating the users record with a new password. I'm new to php programming and just can't get a grasp on this.

Thanks for any help I can get.

Jim
_________________
Jim
View profile  Send private message
mrachow


Posts: 509
Posted: 01/16/2005, 11:44 PM

I'm using event OnClick of form Login, control password
$forValidation = $Login->password->GetValue();

_________________
Best regards,
Michael
View profile  Send private message
jim7567g

Posts: 38
Posted: 01/17/2005, 2:14 AM

I'm not quite sure I fully understand how you do this. I am trying to use a standard editable grid with two fields, one for the old password and one for the new password. When the user clicks the submit button I would like to validate that the the old password is the same as the users current password before updating the database with the new password.

It sounds as if your using the Login.php form to do this? Can you explain or show more of the code your using?

Thanks for the response,

Jim
_________________
Jim
View profile  Send private message
peterr


Posts: 5971
Posted: 01/17/2005, 9:10 AM

Jim,
May I ask why you are not using the standard record form for that?
BTW, I suspect that Michael is using record form, which is named "Login".
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
jim7567g

Posts: 38
Posted: 01/17/2005, 1:37 PM

Hi Peterr, the answer to your question is easy to answer. :-D

Quote :
I'm still learning to program
lol :-)

I guess I should try the record form and see how that works. I think that the name "Login" for a password change form confused me.
_________________
Jim
View profile  Send private message
peterr


Posts: 5971
Posted: 01/17/2005, 1:44 PM

Yeah, I'm also not 100% sure if that was the record form, but it makes most sense. The editable grid is little too complex for simple tasks.
And to be honest I'm still learning to program too :-)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
jim7567g

Posts: 38
Posted: 01/17/2005, 1:46 PM

I'll try the record grid and see if it offers additional ways to validate entries and report back. 8-)
_________________
Jim
View profile  Send private message
jim7567g

Posts: 38
Posted: 01/17/2005, 2:41 PM

Ok, I figured it out. I'll share it here incase there are some other newbies like myself who can benefit from it.

I used a record form and set it to allow update only.

I set 3 control fields in the record grid "current pass, new pass, user login (hidden)"

I set both current pass and new pass to required.

On the user login control field I used Server Before Show event to set the field to the users login from the session using the "Retrieve Value for Control event.

In the forms events I then set a Login event to the Server Before Update event and specified that the users login would come from the hidden user login control and that the password would come from the current password control.

To finish it up I used a custom update to update the user_pass field in the database with the new password control where the users_id was equal to the users session UserID.

It's running like a fined tuned engine now... Yeee Haaa!!! 8-)
_________________
Jim
View profile  Send private message

Add new topic Subscribe to topic   


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

Internet Database

Visually create Web enabled database applications in minutes.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


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