Ajax-How to Use php + jquery to enable the switch button to interact with the background database?

Source: Internet
Author: User
How to Use php + jquery to write a switch to Implement Asynchronous interaction with the background database? requirement: After the button is clicked, the status code is changed to enable and the database status code is changed. When you click the button for the second time, you can switch from the account opening status to the disabled status. How to Use php + jquery to write a switch to achieve Asynchronous interaction with the background database

Requirements:
After the button is clicked, it is changed to the enabled status and the database status code. When you click the button for the second time, it is changed from the account opening status to the disabled status to enable the switch function.

Reply content:

How to Use php + jquery to write a switch to achieve Asynchronous interaction with the background database

Requirements:
After the button is clicked, it is changed to the enabled status and the database status code. When you click the button for the second time, it is changed from the account opening status to the disabled status to enable the switch function.

Easy!

You use jquery's ajax. get a connection. The unique id of the data to be modified is specified in the url. When you click it, the switch quantity is also transmitted in the url parameter, and the server receives the access request, determine, modify, and return the success information based on the id and switch quantity ).

Oh, sometimes the search engine spider accesses this address during get, so pay attention to protection to prevent data leakage.

POST is relatively secure

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.