There's a JavaScript logic that doesn't know how to write.
Web page PHP-based, there is a button to submit a profile modification of the form, where to
1 Fill in the login password to modify, password error to return the wrong password
2 then also check whether it is the same name (requires a little bit weird), if there is a name of the same namesake to pop up a comfirm ask whether to modify, is modified, no stop
This logic doesn't know how to do it, in JavaScript.
------Solution--------------------
Both of these can be separated from PHP, completely without javascript
1 Fill in the login password to modify, password error to return the wrong password
This requires that the Web form be submitted to the php,php connection database, based on the ID entered to isolate the registered password. Compared to the password submitted, if inconsistent, the output "password error"
2 then also check whether it is the same name (requires a little bit weird), if there is a name of the same namesake to pop up a comfirm ask whether to modify, is modified, no stop
Before querying the user's registration password, the column that matches the user name is also queried. If you have more than one, output the modified HTML form, and if you click Cancel, close the page
------Solution--------------------
If it's just a test, use PHP directly to return to the results, and if you need to consider the user's experience, then you have to help Ajax.
Click Submit Ajax to PHP to verify the return results in the previous display.
Is your namesake the same name? Or the same name to divide the surname to separate ... The question is clear, or else people look at the daring. If it's the same name, it's a normal demand, not a weird one.
------Solution--------------------
p.php
PHP Code