jcstanley Posted December 6, 2008 Share Posted December 6, 2008 Hi I am using dreamweaver CS3 to create my site. I have a form which enables an admin user to edit a member's details - one of the options being able to reset the password for that user back to the word "password". A check box which submits a value of 1 if it is ticked and stores it in the "reset" column of the database. When the user attempts to login a query checks the value in the "reset" column. If the value is 1 then the reset password page is displayed, if the value is 0 they login as normal. Anyway, the problem I have is how do I update the password field (to the word password) only if the reset password checkbox is ticked when the form is submitted? I have had a play around with Custom Transactions/Triggers but can't figure it out. Basically I think i need an IF statement to execute when the form is submitted. Any ideas how this can be done? Hope this makes sense! Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/135783-update-2-coulmns-if-checkbox-is-checked/ Share on other sites More sharing options...
shamuntoha Posted December 6, 2008 Share Posted December 6, 2008 Question is not so clear. Is your password encrypted ? by using base64 or md5 then you need to decode it. Two way its mostly encode and decode, either by your front page, or from mysql function itself. $password = "helo"; $encrypt_pwd = base64_encode($password); ($password == $encrypt_pww) ! true : false; $decrypt_pwd = base64_decode($password); ($password == $decrypt_pwd) ! true : false; Quote Link to comment https://forums.phpfreaks.com/topic/135783-update-2-coulmns-if-checkbox-is-checked/#findComment-707564 Share on other sites More sharing options...
jcstanley Posted December 7, 2008 Author Share Posted December 7, 2008 Hi shamuntoha No, the passwords are not encypted. Basically the problem is, when the form is submitted with the reset password checkbox checked (value = 1), the value is stored in the reset column of the table, but the password coulmn in the same table also needs to be updated to the word "password". Is this possible or is there a better way? Quote Link to comment https://forums.phpfreaks.com/topic/135783-update-2-coulmns-if-checkbox-is-checked/#findComment-708421 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.