9911782 Posted July 27, 2006 Share Posted July 27, 2006 Hi There :)Ps help me Its goes like this, I have register all my users, then send them their username & password(temp), then what they need to do:On my user table, I have a flag that I created to check if its the user's first time to login.They will have to Login with username & password I gave them, then after that, the change password option shoul appear to them so that they can put their own password. I have created the Login.php, Login_verify.php, then changepassword.php. On the changepassword.php, I have this :-------------------------------------------<?php if (isset($_POST["btnchangepass"])){ $changed = $_POST['Y']; $password = $_POST['password']; require_once('inc_conn.php'); $sql="SELECT * FROM users WHERE changed = 'N'"; //execute sql statements $rsverify = mysql_query($sql, $connwmis) or die(mysql_error()); //retrieve one row of records $rows_rsverify = mysql_fetch_array($rsverify); if($changed == 'N'){ $updateSQL = "UPDATE users SET password=password('$password'), changed = '$changed' WHERE changed = 'N'"; $execute = mysql_query($updateSQL, $connwmis) or die(mysql_error()); //redirect to viewarticles If ($execute) { mysql_close($connwmis); $msg ="Thank you for changing yout password."; } } }?>------------------------------------------------------But now, I have a problem, It not doing anything.No update nothing.Another thing in the changepassword.php, what do I need to do actually, because to my understanding, I believe that I have to compare the newpassword ,re-enter newpassword, then from there I dont know what to do...Ps help me Thank you Link to comment https://forums.phpfreaks.com/topic/15783-change-password/ Share on other sites More sharing options...
hackerkts Posted July 27, 2006 Share Posted July 27, 2006 [code]$sql="SELECT * FROM users WHERE changed = 'N'";[/code]This part is wrong, you do WHERE username ='$username' AND password='$password'then below you need to add[code]if (rows_rsverify['changed'] == 0){// Blah blah blah...}[/code]This is roughly how it works. Link to comment https://forums.phpfreaks.com/topic/15783-change-password/#findComment-64538 Share on other sites More sharing options...
9911782 Posted August 11, 2006 Author Share Posted August 11, 2006 ;) thank very muchIts working for me now after along time.thankx a million Link to comment https://forums.phpfreaks.com/topic/15783-change-password/#findComment-73018 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.