There's a JavaScript logic that doesn't know how to write a solution.

Source: Internet
Author: User
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
  
   

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.