How does js obtain the checkbox value selected in the shopping cart and return it to php? I want to select checkbox in the shopping cart. js returns the ID number of the selected item and returns it to php, php connects to the database to query the results. Other functions can be implemented. The problem now is how to assign the ID number in js to php? ------ Solution ------------------ form submission or Ajax submission. See which one you are. How does js obtain the checkbox value in the shopping cart and return it to php?
I want to do this now
Check box in the shopping cart, js returns the ID of the selected item and php, and php connects to the database to query the result.
Other functions can be implemented. The problem now is how to assign the ID number in js to php?
------ Solution --------------------
Form or Ajax submission. See which one you are.
------ Solution --------------------
It is better to use ajax, and it can achieve interactions without refreshing.