ignite Posted November 1, 2007 Posted November 1, 2007 Ok well i have done this before with an old game but have just recently got back into coding i no what the problem is bu6t just not how to fix it. if ($_POST ['oldpw] != $ir [userpass'] ) I would remember md5 going around there somwhere just not sure where i should put it :-) 0.o I firgued it now but thanks for looking Quote
ddupuis Posted November 2, 2007 Posted November 2, 2007 Re: Password change if ($_POST['oldpw'] != $ir['userpass']) might help if that's what you had in your script ------------------------------------------------- this changes password on ours.. function pass_change() { global $ir,$c,$userid,$h; print "<h3><u>Password Change</u></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 Password' /></form> > Back"; } function do_pass_change() { global $ir,$c,$userid,$h; if($_POST['oldpw'] != $ir['userpass']) { print "The current password you entered was wrong. > Back"; } else if($_POST['newpw'] !== $_POST['newpw2']) { print "The new passwords you entered did not match! > Back"; } else { mysql_query("UPDATE users SET userpass='{$_POST['newpw']}' WHERE userid=$userid"); print "Password changed! > Back"; } Quote
ignite Posted November 3, 2007 Author Posted November 3, 2007 Re: Password change No it's not that i just missed out a ' because i didn't copy and paste it. It's the md5 bit i need to know. 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.