iseeyou94056 Posted July 20, 2007 Posted July 20, 2007 my users cant change there password it is mested up can someone post a working one for me please Quote
John99 Posted July 20, 2007 Posted July 20, 2007 Re: Change password Here Open preferences.php Find: function pass_change() { global $ir,$c,$userid,$h; print "<h3>Password Change</h3><form action='preferences.php?action=passchange2' method='post'>Current Password: <input type='password' name='oldpw' /> New Password: <input type='password' name='newpw' /> Confirm: <input type='password' name='newpw2' /> <input type='submit' value='Change PW' /></form>"; } function do_pass_change() { global $ir,$c,$userid,$h; if($_POST['oldpw'] != $ir['userpass']) { print "The current password you entered was wrong. [url='preferences.php?action=passchange']> Back[/url]"; } else if($_POST['newpw'] !== $_POST['newpw2']) { print "The new passwords you entered did not match! [url='preferences.php?action=passchange']> Back[/url]"; } else { mysql_query("UPDATE users SET userpass='{$_POST['newpw']}' WHERE userid=$userid",$c); print "Password changed!"; } } Replace with: function pass_change() { global $ir,$c,$userid,$h; print "<h3>Password Change</h3><form action='preferences.php?action=passchange2' method='post'>Current Password: <input type='password' name='oldpw' /> New Password: <input type='password' name='newpw' /> Confirm: <input type='password' name='newpw2' /> <input type='submit' value='Change PW' /></form>"; } function do_pass_change() { global $ir,$c,$userid,$h; if(md5($_POST['oldpw']) != $ir['userpass']) { print "The current password you entered was wrong. [url='preferences.php?action=passchange']> Back[/url]"; } else if($_POST['newpw'] !== $_POST['newpw2']) { print "The new passwords you entered did not match! [url='preferences.php?action=passchange']> Back[/url]"; } else { mysql_query("UPDATE users SET userpass=md5('{$_POST['newpw']}') WHERE userid=$userid",$c); print "Password changed!"; } } Try that it should work ... :) Quote
HITMAN 17 Posted October 31, 2008 Posted October 31, 2008 Re: Change password i this for v1 as i am pretty sure i might need to use it Quote
Tonka Posted October 31, 2008 Posted October 31, 2008 Re: Change password $Bull$$ EYE$ it's easy to spot the difference between v1 v2 v1 has mysql_query v2 has $db->query there are a lot of other differences but that is on of the basics for script add-ons Quote
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.