Goal: Update wpdb each time a user clicks on a specific button.
Every time a user clicks on a button, I need jQuery to run a function that will update my wordpress database. As far as I understand, this must be done through an AJAX request sent to a php file residing on the server. This article seems to address my issue, but I am having trouble interpreting exactly what it is I need to do.
A couple of my questions are as follows:
- I will need a php file that will be called from the jQuery function, but where should that file be housed? I believe it should be at http:mysite.com/phpfile.php, but how can I get the file to be housed at that location?
- What exactly should this php file consist of?
If someone is able to give me the steps needed to accomplish this goal, I would be forever grateful. Thanks!