5) { $ret = true; } else { if (!$pass) { $passwdError = "No password given!"; } elseif ((!$copy) || ($pass != $copy)) { $passwdError = "Passwords don't match!"; } elseif (strlen ($pass) <= 5) { $passwdError = "Password too short."; } else { $passwdError = "Unknown"; } } return $ret; } if ($test) { if (chkpass ($newpass, $confirm)) { $query = "UPDATE members SET u_password=ENCRYPT('$newpass', '$user')" ." WHERE u_username='$user'" ." AND u_password=ENCRYPT('$oldpass', '$user')"; $result = sqlWriteQuery ($query); if ($result === null) { echo "
Sorry, couldn't talk to the database. Nothing changed.
"; } elseif ($result === false) { echo "Something went wrong, MySQL said '$sqlError'.
"; } elseif ($result == 0) { echo "Your old password was entered incorrectly, or was the same as the old one.
"; } elseif ($result == 1) { echo "Your password has been changed.
"; } else { echo "Uh oh, SERIOUSLY bad mojo. Find Deek ASAP!
"; } } else { echo $passwdError; } } else { ?>