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