Thank you Dave.
It appeared that actually my code worked (partially).
When I enter the wrong current password, it doesn't update anything, appropriately. But It is not showing any errors to the user.
the var_dump($response); showed the following:
PHP Code:
array(2) { ["errors"]=> array(1) { [0]=> array(2) { [0]=> string(11) "badpassword" [1]=> string(40) "https://mydomain.com/forum/lostpw" } } ["userid"]=> string(2) "19" }
I know this is the error message, but I'm not sure how can I write the if statement that if there is an error, then show a message. Meaning, how can I capture this error in the php script?
The other problem is that even when I enter the correct current password, it only updates the email and password and DOES NOT update the username. I'm not sure why.